Skip to content

Commit 08490a9

Browse files
authored
test: branch properties of main and release/* (#145)
## Why this should be merged Safer release process by enforcing invariants of `release/*` branches as automated in #137 to fulfil #25. ## How this works New test for `go_tooling` CI job. If the PR target branch is `main` then only the `params.ReleaseType` is checked. If the target is neither `main` nor a release branch then the test is skipped. The checks performed on `release/*` branches are described in the test. ## How this was tested Locally against a dummy release branch with deliberate problems created by (a) including this PR's changes in the final commit and (b) not updating the libevm version. ``` $ go test -v ./... --target_branch="release/v1.13.14-0.1.0.rc.3" === RUN TestCherryPicksFormat --- PASS: TestCherryPicksFormat (0.39s) === RUN TestBranchProperties === RUN TestBranchProperties/branch_name release_test.go:172: Error Trace: .../ava-labs/libevm/libevm/tooling/release/release_test.go:172 Error: Not equal: expected: "release/v1.13.14-0.1.0.beta" actual : "release/v1.13.14-0.1.0.rc.3" Diff: --- Expected +++ Actual @@ -1 +1 @@ -release/v1.13.14-0.1.0.beta +release/v1.13.14-0.1.0.rc.3 Test: TestBranchProperties/branch_name release_test.go:175: On release branch; params.LibEVMReleaseType = "beta", which is unsuitable for release branches === RUN TestBranchProperties/commit_history release_test.go:192: Forked from "main" at commit 4c6e50e (chore: module-renaming workflow inverts between `libevm` and `geth` (#152)) release_test.go:314: ### History since fork from default branch (8 commits): release_test.go:316: internal/build, rpc: add missing HTTP response body Close() calls (ethereum#29223) by Shiming Zhang <[email protected]> release_test.go:316: core/state: fix bug in statedb.Copy and remove unnecessary preallocation (ethereum#29563) by Aaron Chen <[email protected]> release_test.go:316: params: print time value instead of pointer in ConfigCompatError (ethereum#29514) by Nathan <[email protected]> release_test.go:316: eth/gasprice: add query limit for FeeHistory to defend DDOS attack (ethereum#29644) by Nathan <[email protected]> release_test.go:316: core/state/snapshot: add a missing lock (ethereum#30001) by maskpp <[email protected]> release_test.go:316: crypto: add IsOnCurve check (ethereum#31100) by Felix Lange <[email protected]> release_test.go:316: internal/ethapi: fix panic in debug methods (ethereum#31157) by Sina M <[email protected]> release_test.go:316: x by Arran Schlosberg <[email protected]> === RUN TestBranchProperties/commit_history/cherry_picked_commits release_test.go:314: ### Expected cherry-picks (7 commits): release_test.go:316: internal/build, rpc: add missing HTTP response body Close() calls (ethereum#29223) by Shiming Zhang <[email protected]> release_test.go:316: core/state: fix bug in statedb.Copy and remove unnecessary preallocation (ethereum#29563) by Aaron Chen <[email protected]> release_test.go:316: params: print time value instead of pointer in ConfigCompatError (ethereum#29514) by Nathan <[email protected]> release_test.go:316: eth/gasprice: add query limit for FeeHistory to defend DDOS attack (ethereum#29644) by Nathan <[email protected]> release_test.go:316: core/state/snapshot: add a missing lock (ethereum#30001) by maskpp <[email protected]> release_test.go:316: crypto: add IsOnCurve check (ethereum#31100) by Felix Lange <[email protected]> release_test.go:316: internal/ethapi: fix panic in debug methods (ethereum#31157) by Sina M <[email protected]> === RUN TestBranchProperties/commit_history/final_commit release_test.go:365: Modified disallowed file "go.yml" release_test.go:365: Modified disallowed file "go.mod" release_test.go:365: Modified disallowed file "go.sum" release_test.go:365: Modified disallowed file "release_test.go" --- FAIL: TestBranchProperties (2.07s) --- FAIL: TestBranchProperties/branch_name (0.00s) --- FAIL: TestBranchProperties/commit_history (2.07s) --- PASS: TestBranchProperties/commit_history/cherry_picked_commits (1.81s) --- FAIL: TestBranchProperties/commit_history/final_commit (0.01s) FAIL FAIL github.com/ava-labs/libevm/libevm/tooling/release 2.712s FAIL ```
1 parent 433c606 commit 08490a9

File tree

6 files changed

+450
-85
lines changed

6 files changed

+450
-85
lines changed

.github/workflows/go.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ jobs:
4545
defaults:
4646
run:
4747
working-directory: ./libevm/tooling
48+
env:
49+
TARGET_BRANCH: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref }}
4850
steps:
4951
- uses: actions/checkout@v4
5052
with:
@@ -53,7 +55,8 @@ jobs:
5355
uses: actions/setup-go@v5
5456
with:
5557
go-version-file: "./libevm/tooling/go.mod"
56-
- run: go test ./...
58+
- run: git branch main origin/main
59+
- run: go test -v ./... --target_branch="${{ env.TARGET_BRANCH }}"
5760

5861
go_generate:
5962
env:

libevm/tooling/go.mod

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,40 @@
11
module github.com/ava-labs/libevm/libevm/tooling
22

3-
go 1.23
3+
go 1.23.0
4+
5+
replace github.com/ava-labs/libevm => ../../
46

57
require (
6-
github.com/go-git/go-git/v5 v5.13.2
7-
github.com/google/go-cmp v0.6.0
8+
github.com/ava-labs/libevm v0.0.0-00010101000000-000000000000
9+
github.com/go-git/go-git/v5 v5.14.0
10+
github.com/google/go-cmp v0.7.0
811
github.com/stretchr/testify v1.10.0
912
)
1013

1114
require (
1215
dario.cat/mergo v1.0.0 // indirect
13-
github.com/Microsoft/go-winio v0.6.1 // indirect
16+
github.com/Microsoft/go-winio v0.6.2 // indirect
1417
github.com/ProtonMail/go-crypto v1.1.5 // indirect
15-
github.com/cloudflare/circl v1.3.7 // indirect
16-
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
18+
github.com/cloudflare/circl v1.6.0 // indirect
19+
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
1720
github.com/davecgh/go-spew v1.1.1 // indirect
1821
github.com/emirpasic/gods v1.18.1 // indirect
1922
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
2023
github.com/go-git/go-billy/v5 v5.6.2 // indirect
21-
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
24+
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
25+
github.com/holiman/uint256 v1.2.4 // indirect
2226
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
2327
github.com/kevinburke/ssh_config v1.2.0 // indirect
2428
github.com/pjbgf/sha1cd v0.3.2 // indirect
2529
github.com/pmezard/go-difflib v1.0.0 // indirect
2630
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
27-
github.com/skeema/knownhosts v1.3.0 // indirect
31+
github.com/skeema/knownhosts v1.3.1 // indirect
2832
github.com/xanzy/ssh-agent v0.3.3 // indirect
29-
golang.org/x/crypto v0.32.0 // indirect
30-
golang.org/x/mod v0.17.0 // indirect
31-
golang.org/x/net v0.34.0 // indirect
33+
golang.org/x/crypto v0.35.0 // indirect
34+
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
35+
golang.org/x/net v0.35.0 // indirect
3236
golang.org/x/sync v0.10.0 // indirect
33-
golang.org/x/sys v0.29.0 // indirect
34-
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
37+
golang.org/x/sys v0.30.0 // indirect
3538
gopkg.in/warnings.v0 v0.1.2 // indirect
3639
gopkg.in/yaml.v3 v3.0.1 // indirect
3740
)

0 commit comments

Comments
 (0)