diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fadd44b9..cdb6cb83 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 != ''" diff --git a/.gitignore b/.gitignore index 527a1e29..ebf6f371 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ golangci-lint coverage.txt *.out sim_log_file +importer/tmp # Vagrant .vagrant/ diff --git a/Makefile b/Makefile index 6ac45fa3..b8a81ef6 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/importer/importer_test.go b/importer/importer_test.go index 3df01cac..fa91f288 100644 --- a/importer/importer_test.go +++ b/importer/importer_test.go @@ -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()