actions: fix test-importer workflow (#410)

* actions: fix test-importer workflow

* update gitignore
This commit is contained in:
Federico Kunze 2020-07-24 20:54:25 +02:00 committed by GitHub
parent cc6b5d04f2
commit 8789a04998
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 18 deletions

View File

@ -193,20 +193,20 @@ jobs:
file: ./coverage.txt
fail_ci_if_error: true
if: "env.GIT_DIFF != ''"
# TODO: remove tmp dir to fix this
# test-importer:
# runs-on: ubuntu-latest
# timeout-minutes: 10
# steps:
# - uses: actions/checkout@v2
# - uses: technote-space/get-diff-action@v1
# id: git_diff
# with:
# SUFFIX_FILTER: |
# .go
# .mod
# .sum
# - name: importer-test
# run: |
# make test-import
# if: "env.GIT_DIFF != ''"
test-importer:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v1
id: git_diff
with:
SUFFIX_FILTER: |
.go
.mod
.sum
- name: test-importer
run: |
make test-import
if: "env.GIT_DIFF != ''"

1
.gitignore vendored
View File

@ -33,6 +33,7 @@ golangci-lint
coverage.txt
*.out
sim_log_file
importer/tmp
# Vagrant
.vagrant/

View File

@ -150,6 +150,7 @@ test-race:
test-import:
@go test ./importer -v --vet=off --run=TestImportBlocks --datadir tmp \
--blockchain blockchain --timeout=10m
rm -rf importer/tmp
test-rpc:
./scripts/integration-test-all.sh -q 1 -z 1 -s 2

View File

@ -207,7 +207,10 @@ func TestImportBlocks(t *testing.T) {
blockchainInput, err := os.Open(flagBlockchain)
require.Nil(t, err)
defer require.NoError(t, blockchainInput.Close())
defer func() {
err := blockchainInput.Close()
require.NoError(t, err)
}()
// ethereum mainnet config
chainContext := core.NewChainContext()