Skip to content

Commit

Permalink
Merge pull request #373 from bnb-chain/develop
Browse files Browse the repository at this point in the history
release: prepare release for v0.2.3-alpha.7
  • Loading branch information
forcodedancing authored Jul 25, 2023
2 parents fc96aac + 4afe032 commit 2733208
Show file tree
Hide file tree
Showing 39 changed files with 1,594 additions and 409 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,24 @@ jobs:
- name: run e2e test
run: |
make e2e_test
- name: stop e2e local chain
run: |
make e2e_stop_localchain
- name: make coverage report
id: coverage-report
if: github.event_name == 'pull_request'
continue-on-error: true
run: |
echo '## E2E Test Coverage Report' >> coverage-report.txt
echo 'commit-id: ${{ github.event.pull_request.head.sha }}' >> coverage-report.txt
echo 'generated by https://github.com/vladopajic/go-test-coverage' >> coverage-report.txt
echo >> coverage-report.txt
echo '<details><summary>Additional details and impacted files</summary>' >> coverage-report.txt
echo >> coverage-report.txt
echo '```' >> coverage-report.txt
make check-e2e-coverage >> coverage-report.txt
echo '```' >> coverage-report.txt
echo >> coverage-report.txt
echo '</details>' >> coverage-report.txt
cat coverage-report.txt >> $GITHUB_STEP_SUMMARY
42 changes: 42 additions & 0 deletions .testcoverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# (mandatory)
# Path to coverprofile file (output of `go test -coverprofile` command)
profile: coverage.out

# (optional)
# When specified reported file paths will not contain local prefix in the output
local-prefix: "github.com/bnb-chain/greenfield"

# Holds coverage thresholds percentages, values should be in range [0-100]
threshold:
# (optional; default 0)
# The minimum coverage that each file should have
file: 80

# (optional; default 0)
# The minimum coverage that each package should have
package: 80

# (optional; default 0)
# The minimum total coverage project should have
total: 80

# Holds regexp rules which will override thresholds for matched files or packages
override:
# Increase coverage threshold to 100% for `foo` package (default is 80, as configured above)
# - threshold: 100
# path: ^pkg/lib/foo$

# Holds regexp rules which will exclude matched files or packages from coverage statistics
exclude:
# Exclude files or packages matching their paths
paths:
- \.pb\.go$ # excludes all protobuf generated files
- \.pb\.gw\.go$ # excludes all protobuf generated files
- .*_mocks.go$ # excludes all protobuf generated files
- testutil/.*
- e2e/.*
- internal/sequence/.*

# NOTES:
# - symbol `/` in all path regexps will be replaced by
# current OS file path separator to properly work on Windows
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 0.2.3-alpha.7
This release includes 2 features and 3 bugfixes.

Features:
* [#366](https://github.com/bnb-chain/greenfield/pull/366) feat: add strategy for event emit
* [#368](https://github.com/bnb-chain/greenfield/pull/368) feat: limit sp slash amount and add query api

Bugfixes:
* [#369](https://github.com/bnb-chain/greenfield/pull/369) fix: parse failed when object name contains /
* [#370](https://github.com/bnb-chain/greenfield/pull/370) fix: fix the precision issue of storage bill
* [#371](https://github.com/bnb-chain/greenfield/pull/371) fix: add src dst sp check when migrate bucket

Chores:
* [#365](https://github.com/bnb-chain/greenfield/pull/365) ci: add e2e test coverage report

## 0.2.3-alpha.6
This release includes 6 features and 5 bugfixes.

Expand Down
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.PHONY: build build-linux build-macos build-windows
.PHONY: tools proto-gen proto-format test e2e_test ci lint
.PHONY: install-go-test-coverage check-coverage

VERSION=$(shell git describe --tags --always)
GIT_COMMIT=$(shell git rev-parse HEAD)
Expand All @@ -8,6 +9,8 @@ REPO=github.com/bnb-chain/greenfield
IMAGE_NAME=ghcr.io/bnb-chain/greenfield
REPO=github.com/bnb-chain/greenfield

GOBIN ?= $$(go env GOPATH)/bin

ldflags = -X $(REPO)/version.AppVersion=$(VERSION) \
-X $(REPO)/version.GitCommit=$(GIT_COMMIT) \
-X $(REPO)/version.GitCommitDate=$(GIT_COMMIT_DATE)
Expand Down Expand Up @@ -51,8 +54,17 @@ test:
e2e_start_localchain:
bash ./deployment/localup/localup.sh all 1 7

e2e_stop_localchain:
bash ./deployment/localup/localup.sh stop

e2e_test:
go test -p 1 -failfast -v ./e2e/... -timeout 99999s
go test -p 1 -failfast -v ./e2e/... -coverpkg=./... -covermode=atomic -coverprofile=./coverage.out -timeout 99999s

install-go-test-coverage:
@go install github.com/vladopajic/go-test-coverage/v2@latest

check-e2e-coverage: install-go-test-coverage
@go-test-coverage --config=./.testcoverage.yml || true

lint:
golangci-lint run --fix
Expand Down
1 change: 1 addition & 0 deletions cmd/gnfd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ func (a appCreator) newApp(
&app.AppConfig{Config: *serverConfig, CrossChain: appConfig.CrossChain},
appOpts,
baseapp.SetPruning(pruningOpts),
baseapp.SetEventing(cast.ToString(appOpts.Get(server.FlagEventing))),
baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))),
baseapp.SetMinRetainBlocks(cast.ToUint64(appOpts.Get(server.FlagMinRetainBlocks))),
baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))),
Expand Down
2 changes: 1 addition & 1 deletion e2e/core/basesuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ func (s *BaseSuite) RefreshGVGFamilies() {
}

gvgsResp, err3 := s.Client.GlobalVirtualGroupByFamilyID(context.Background(), &virtualgroupmoduletypes.QueryGlobalVirtualGroupByFamilyIDRequest{
StorageProviderId: sp.Info.Id,
GlobalVirtualGroupFamilyId: gvgFamily.Id,
})
s.Require().NoError(err3)
sp.GlobalVirtualGroupFamilies[gvgFamily.Id] = gvgsResp.GlobalVirtualGroups
s.StorageProviders[gvgFamily.PrimarySpId] = sp
s.T().Logf("resp: %s", gvgsResp.String())
}
}

Expand Down
Loading

0 comments on commit 2733208

Please sign in to comment.