mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
.github, internal/flags: improve actions test runs (#32150)
This change enables more tests to run on GitHub actions. First, it removes the `-short` flag passed to `go test`, unskipping some longer running tests. We also enable the full consensus tests to run by enabling submodules during git clone. The EF now operates org wide runners with the `self-hosted-ghr` label. These are auto-scaling runners which should ideally allow us to process any amount of testing load we throw at them. The new runners have `HOME` configured differently from the actual user home directory, so our internal test for resolving `~` had to be adapted to work in this scenario.
This commit is contained in:
parent
f0741e6dfe
commit
84f2932b1e
2 changed files with 26 additions and 17 deletions
36
.github/workflows/go.yml
vendored
36
.github/workflows/go.yml
vendored
|
|
@ -1,18 +1,20 @@
|
||||||
name: i386 linux tests
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches:
|
||||||
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches:
|
||||||
|
- master
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
name: Lint
|
name: Lint
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted-ghr
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: false
|
||||||
|
|
||||||
# Cache build tools to avoid downloading them each time
|
# Cache build tools to avoid downloading them each time
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
|
|
@ -23,7 +25,7 @@ jobs:
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.23.0
|
go-version: 1.24
|
||||||
cache: false
|
cache: false
|
||||||
|
|
||||||
- name: Run linters
|
- name: Run linters
|
||||||
|
|
@ -32,17 +34,25 @@ jobs:
|
||||||
go run build/ci.go check_generate
|
go run build/ci.go check_generate
|
||||||
go run build/ci.go check_baddeps
|
go run build/ci.go check_baddeps
|
||||||
|
|
||||||
build:
|
test:
|
||||||
runs-on: self-hosted
|
name: Test
|
||||||
|
needs: lint
|
||||||
|
runs-on: self-hosted-ghr
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
go:
|
||||||
|
- '1.24'
|
||||||
|
- '1.23'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.24.0
|
go-version: ${{ matrix.go }}
|
||||||
cache: false
|
cache: false
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: go test -short ./...
|
run: go test ./...
|
||||||
env:
|
|
||||||
GOOS: linux
|
|
||||||
GOARCH: 386
|
|
||||||
|
|
|
||||||
|
|
@ -17,19 +17,18 @@
|
||||||
package flags
|
package flags
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os/user"
|
|
||||||
"runtime"
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestPathExpansion(t *testing.T) {
|
func TestPathExpansion(t *testing.T) {
|
||||||
user, _ := user.Current()
|
home := HomeDir()
|
||||||
var tests map[string]string
|
var tests map[string]string
|
||||||
|
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
tests = map[string]string{
|
tests = map[string]string{
|
||||||
`/home/someuser/tmp`: `\home\someuser\tmp`,
|
`/home/someuser/tmp`: `\home\someuser\tmp`,
|
||||||
`~/tmp`: user.HomeDir + `\tmp`,
|
`~/tmp`: home + `\tmp`,
|
||||||
`~thisOtherUser/b/`: `~thisOtherUser\b`,
|
`~thisOtherUser/b/`: `~thisOtherUser\b`,
|
||||||
`$DDDXXX/a/b`: `\tmp\a\b`,
|
`$DDDXXX/a/b`: `\tmp\a\b`,
|
||||||
`/a/b/`: `\a\b`,
|
`/a/b/`: `\a\b`,
|
||||||
|
|
@ -40,7 +39,7 @@ func TestPathExpansion(t *testing.T) {
|
||||||
} else {
|
} else {
|
||||||
tests = map[string]string{
|
tests = map[string]string{
|
||||||
`/home/someuser/tmp`: `/home/someuser/tmp`,
|
`/home/someuser/tmp`: `/home/someuser/tmp`,
|
||||||
`~/tmp`: user.HomeDir + `/tmp`,
|
`~/tmp`: home + `/tmp`,
|
||||||
`~thisOtherUser/b/`: `~thisOtherUser/b`,
|
`~thisOtherUser/b/`: `~thisOtherUser/b`,
|
||||||
`$DDDXXX/a/b`: `/tmp/a/b`,
|
`$DDDXXX/a/b`: `/tmp/a/b`,
|
||||||
`/a/b/`: `/a/b`,
|
`/a/b/`: `/a/b`,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue