fix test conditional skip

This commit is contained in:
i-norden 2021-12-29 15:20:12 -06:00
parent ace7eaad7d
commit f3c247b54b
3 changed files with 49 additions and 7 deletions

View File

@ -62,7 +62,7 @@ jobs:
make integrationtest
integrationtest_forwardethcalls:
name: Run integration tests
name: Run integration tests for direct proxy fall-through of eth_calls
env:
GOPATH: /tmp/go
DB_WRITE: false

View File

@ -20,9 +20,6 @@ import (
var _ = Describe("Integration test", func() {
directProxyEthCalls, err := strconv.ParseBool(os.Getenv("ETH_FORWARD_ETH_CALLS"))
Expect(err).To(BeNil())
if !directProxyEthCalls {
Skip("skipping direct-proxy-forwarding integration tests")
}
gethHttpPath := "http://127.0.0.1:8545"
gethClient, err := ethclient.Dial(gethHttpPath)
Expect(err).ToNot(HaveOccurred())
@ -43,6 +40,9 @@ var _ = Describe("Integration test", func() {
Describe("get Block", func() {
BeforeEach(func() {
if !directProxyEthCalls {
Skip("skipping direct-proxy-forwarding integration tests")
}
contract, contractErr = integration.DeployContract()
time.Sleep(sleepInterval)
})
@ -94,6 +94,9 @@ var _ = Describe("Integration test", func() {
Describe("Transaction", func() {
BeforeEach(func() {
if !directProxyEthCalls {
Skip("skipping direct-proxy-forwarding integration tests")
}
contract, contractErr = integration.DeployContract()
time.Sleep(sleepInterval)
})
@ -119,6 +122,9 @@ var _ = Describe("Integration test", func() {
Describe("Receipt", func() {
BeforeEach(func() {
if !directProxyEthCalls {
Skip("skipping direct-proxy-forwarding integration tests")
}
contract, contractErr = integration.DeployContract()
time.Sleep(sleepInterval)
})
@ -136,6 +142,9 @@ var _ = Describe("Integration test", func() {
Describe("FilterLogs", func() {
BeforeEach(func() {
if !directProxyEthCalls {
Skip("skipping direct-proxy-forwarding integration tests")
}
contract, contractErr = integration.DeployContract()
time.Sleep(sleepInterval)
})
@ -160,6 +169,9 @@ var _ = Describe("Integration test", func() {
Describe("CodeAt", func() {
BeforeEach(func() {
if !directProxyEthCalls {
Skip("skipping direct-proxy-forwarding integration tests")
}
contract, contractErr = integration.DeployContract()
time.Sleep(sleepInterval)
})
@ -207,6 +219,9 @@ var _ = Describe("Integration test", func() {
Describe("Get balance", func() {
address := "0x1111111111111111111111111111111111111112"
BeforeEach(func() {
if !directProxyEthCalls {
Skip("skipping direct-proxy-forwarding integration tests")
}
tx, txErr = integration.SendEth(address, "0.01")
time.Sleep(sleepInterval)
})
@ -270,6 +285,9 @@ var _ = Describe("Integration test", func() {
Describe("Get Storage", func() {
BeforeEach(func() {
if !directProxyEthCalls {
Skip("skipping direct-proxy-forwarding integration tests")
}
contract, contractErr = integration.DeployContract()
erc20TotalSupply, bigIntResult = new(big.Int).SetString("1000000000000000000000", 10)
@ -383,6 +401,9 @@ var _ = Describe("Integration test", func() {
Describe("eth call", func() {
BeforeEach(func() {
if !directProxyEthCalls {
Skip("skipping direct-proxy-forwarding integration tests")
}
contract, contractErr = integration.DeployContract()
erc20TotalSupply, bigIntResult = new(big.Int).SetString("1000000000000000000000", 10)

View File

@ -31,9 +31,6 @@ var (
var _ = Describe("Integration test", func() {
directProxyEthCalls, err := strconv.ParseBool(os.Getenv("ETH_FORWARD_ETH_CALLS"))
Expect(err).To(BeNil())
if directProxyEthCalls {
Skip("skipping no-direct-proxy-forwarding integration tests")
}
gethHttpPath := "http://127.0.0.1:8545"
gethClient, err := ethclient.Dial(gethHttpPath)
Expect(err).ToNot(HaveOccurred())
@ -54,6 +51,9 @@ var _ = Describe("Integration test", func() {
Describe("get Block", func() {
BeforeEach(func() {
if directProxyEthCalls {
Skip("skipping no-direct-proxy-forwarding integration tests")
}
contract, contractErr = integration.DeployContract()
time.Sleep(sleepInterval)
})
@ -123,6 +123,9 @@ var _ = Describe("Integration test", func() {
Describe("Transaction", func() {
BeforeEach(func() {
if directProxyEthCalls {
Skip("skipping no-direct-proxy-forwarding integration tests")
}
contract, contractErr = integration.DeployContract()
time.Sleep(sleepInterval)
})
@ -154,6 +157,9 @@ var _ = Describe("Integration test", func() {
Describe("Receipt", func() {
BeforeEach(func() {
if directProxyEthCalls {
Skip("skipping no-direct-proxy-forwarding integration tests")
}
contract, contractErr = integration.DeployContract()
time.Sleep(sleepInterval)
})
@ -181,6 +187,9 @@ var _ = Describe("Integration test", func() {
Describe("FilterLogs", func() {
BeforeEach(func() {
if directProxyEthCalls {
Skip("skipping no-direct-proxy-forwarding integration tests")
}
contract, contractErr = integration.DeployContract()
time.Sleep(sleepInterval)
})
@ -211,6 +220,9 @@ var _ = Describe("Integration test", func() {
Describe("CodeAt", func() {
BeforeEach(func() {
if directProxyEthCalls {
Skip("skipping no-direct-proxy-forwarding integration tests")
}
contract, contractErr = integration.DeployContract()
time.Sleep(sleepInterval)
})
@ -258,6 +270,9 @@ var _ = Describe("Integration test", func() {
Describe("Get balance", func() {
address := "0x1111111111111111111111111111111111111112"
BeforeEach(func() {
if directProxyEthCalls {
Skip("skipping no-direct-proxy-forwarding integration tests")
}
tx, txErr = integration.SendEth(address, "0.01")
time.Sleep(sleepInterval)
})
@ -321,6 +336,9 @@ var _ = Describe("Integration test", func() {
Describe("Get Storage", func() {
BeforeEach(func() {
if directProxyEthCalls {
Skip("skipping no-direct-proxy-forwarding integration tests")
}
contract, contractErr = integration.DeployContract()
erc20TotalSupply, bigIntResult = new(big.Int).SetString("1000000000000000000000", 10)
@ -434,6 +452,9 @@ var _ = Describe("Integration test", func() {
Describe("eth call", func() {
BeforeEach(func() {
if directProxyEthCalls {
Skip("skipping no-direct-proxy-forwarding integration tests")
}
contract, contractErr = integration.DeployContract()
erc20TotalSupply, bigIntResult = new(big.Int).SetString("1000000000000000000000", 10)