Re-enable integration tests (#4871)

When Integration tests were migrated to JUnit 5 the gradle configuration was not added.
Fix various tests that had broken in the meantime:
 - NPEs when EnclaveEncryptorType was introduced
 - Account for new future nonce restrictions in the txpool

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Co-authored-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
pull/4887/head
Danno Ferrin 2 years ago committed by GitHub
parent 4508174ef2
commit 9dbf12058a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      build.gradle
  2. 10
      enclave/src/integration-test/java/org/hyperledger/besu/enclave/EnclaveTest.java
  3. 2
      ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/fork/frontier/EthGetFilterChangesIntegrationTest.java
  4. 6
      ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/fork/frontier/PrivGetPrivateTransactionIntegrationTest.java
  5. 2
      ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/fork/london/EthGetFilterChangesIntegrationTest.java
  6. 6
      ethereum/core/src/integration-test/java/org/hyperledger/besu/ethereum/mainnet/precompiles/privacy/PrivacyPrecompiledContractIntegrationTest.java

@ -344,6 +344,7 @@ subprojects {
testClassesDirs = sourceSets.integrationTest.output.classesDirs testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath classpath = sourceSets.integrationTest.runtimeClasspath
outputs.upToDateWhen { false } outputs.upToDateWhen { false }
useJUnitPlatform {}
} }
} }

@ -21,6 +21,7 @@ import static org.assertj.core.api.Assertions.catchThrowable;
import org.hyperledger.besu.enclave.types.PrivacyGroup; import org.hyperledger.besu.enclave.types.PrivacyGroup;
import org.hyperledger.besu.enclave.types.ReceiveResponse; import org.hyperledger.besu.enclave.types.ReceiveResponse;
import org.hyperledger.besu.enclave.types.SendResponse; import org.hyperledger.besu.enclave.types.SendResponse;
import org.hyperledger.enclave.testutil.EnclaveEncryptorType;
import org.hyperledger.enclave.testutil.EnclaveKeyConfiguration; import org.hyperledger.enclave.testutil.EnclaveKeyConfiguration;
import org.hyperledger.enclave.testutil.TesseraTestHarness; import org.hyperledger.enclave.testutil.TesseraTestHarness;
import org.hyperledger.enclave.testutil.TesseraTestHarnessFactory; import org.hyperledger.enclave.testutil.TesseraTestHarnessFactory;
@ -47,11 +48,11 @@ public class EnclaveTest {
private static final String PAYLOAD = "a wonderful transaction"; private static final String PAYLOAD = "a wonderful transaction";
private static final String MOCK_KEY = "iOCzoGo5kwtZU0J41Z9xnGXHN6ZNukIa9MspvHtu3Jk="; private static final String MOCK_KEY = "iOCzoGo5kwtZU0J41Z9xnGXHN6ZNukIa9MspvHtu3Jk=";
private static Enclave enclave; private Enclave enclave;
private Vertx vertx; private Vertx vertx;
private EnclaveFactory factory; private EnclaveFactory factory;
private static TesseraTestHarness testHarness; private TesseraTestHarness testHarness;
@BeforeEach @BeforeEach
public void setUp() throws Exception { public void setUp() throws Exception {
@ -62,7 +63,10 @@ public class EnclaveTest {
TesseraTestHarnessFactory.create( TesseraTestHarnessFactory.create(
"enclave", "enclave",
Files.createTempDirectory(folder, "enclave"), Files.createTempDirectory(folder, "enclave"),
new EnclaveKeyConfiguration("enclave_key_0.pub", "enclave_key_0.key"), new EnclaveKeyConfiguration(
new String[] {"enclave_key_0.pub"},
new String[] {"enclave_key_0.key"},
EnclaveEncryptorType.NOOP),
Optional.empty()); Optional.empty());
testHarness.start(); testHarness.start();

@ -297,7 +297,7 @@ public class EthGetFilterChangesIntegrationTest {
.type(TransactionType.FRONTIER) .type(TransactionType.FRONTIER)
.gasLimit(100) .gasLimit(100)
.gasPrice(Wei.ZERO) .gasPrice(Wei.ZERO)
.nonce(1) .nonce(0)
.payload(Bytes.EMPTY) .payload(Bytes.EMPTY)
.to(Address.ID) .to(Address.ID)
.value(Wei.of(transactionNumber)) .value(Wei.of(transactionNumber))

@ -47,6 +47,7 @@ import org.hyperledger.besu.ethereum.privacy.RestrictedDefaultPrivacyController;
import org.hyperledger.besu.ethereum.privacy.storage.PrivateStateStorage; import org.hyperledger.besu.ethereum.privacy.storage.PrivateStateStorage;
import org.hyperledger.besu.ethereum.rlp.BytesValueRLPOutput; import org.hyperledger.besu.ethereum.rlp.BytesValueRLPOutput;
import org.hyperledger.besu.plugin.data.Restriction; import org.hyperledger.besu.plugin.data.Restriction;
import org.hyperledger.enclave.testutil.EnclaveEncryptorType;
import org.hyperledger.enclave.testutil.EnclaveKeyConfiguration; import org.hyperledger.enclave.testutil.EnclaveKeyConfiguration;
import org.hyperledger.enclave.testutil.TesseraTestHarness; import org.hyperledger.enclave.testutil.TesseraTestHarness;
import org.hyperledger.enclave.testutil.TesseraTestHarnessFactory; import org.hyperledger.enclave.testutil.TesseraTestHarnessFactory;
@ -127,7 +128,10 @@ public class PrivGetPrivateTransactionIntegrationTest {
TesseraTestHarnessFactory.create( TesseraTestHarnessFactory.create(
"enclave", "enclave",
Files.createTempDirectory(folder, "enclave"), Files.createTempDirectory(folder, "enclave"),
new EnclaveKeyConfiguration("enclave_key_0.pub", "enclave_key_0.key"), new EnclaveKeyConfiguration(
new String[] {"enclave_key_0.pub"},
new String[] {"enclave_key_0.key"},
EnclaveEncryptorType.NOOP),
Optional.empty()); Optional.empty());
testHarness.start(); testHarness.start();

@ -297,7 +297,7 @@ public class EthGetFilterChangesIntegrationTest {
.type(TransactionType.FRONTIER) .type(TransactionType.FRONTIER)
.gasLimit(100) .gasLimit(100)
.gasPrice(Wei.ZERO) .gasPrice(Wei.ZERO)
.nonce(1) .nonce(0)
.payload(Bytes.EMPTY) .payload(Bytes.EMPTY)
.to(Address.ID) .to(Address.ID)
.value(Wei.of(transactionNumber)) .value(Wei.of(transactionNumber))

@ -50,6 +50,7 @@ import org.hyperledger.besu.evm.gascalculator.SpuriousDragonGasCalculator;
import org.hyperledger.besu.evm.precompile.PrecompiledContract; import org.hyperledger.besu.evm.precompile.PrecompiledContract;
import org.hyperledger.besu.evm.tracing.OperationTracer; import org.hyperledger.besu.evm.tracing.OperationTracer;
import org.hyperledger.besu.evm.worldstate.WorldUpdater; import org.hyperledger.besu.evm.worldstate.WorldUpdater;
import org.hyperledger.enclave.testutil.EnclaveEncryptorType;
import org.hyperledger.enclave.testutil.EnclaveKeyConfiguration; import org.hyperledger.enclave.testutil.EnclaveKeyConfiguration;
import org.hyperledger.enclave.testutil.TesseraTestHarness; import org.hyperledger.enclave.testutil.TesseraTestHarness;
import org.hyperledger.enclave.testutil.TesseraTestHarnessFactory; import org.hyperledger.enclave.testutil.TesseraTestHarnessFactory;
@ -123,7 +124,10 @@ public class PrivacyPrecompiledContractIntegrationTest {
TesseraTestHarnessFactory.create( TesseraTestHarnessFactory.create(
"enclave", "enclave",
Files.createTempDirectory(folder, "enclave"), Files.createTempDirectory(folder, "enclave"),
new EnclaveKeyConfiguration("enclave_key_0.pub", "enclave_key_1.key"), new EnclaveKeyConfiguration(
new String[] {"enclave_key_0.pub"},
new String[] {"enclave_key_1.key"},
EnclaveEncryptorType.NOOP),
Optional.empty()); Optional.empty());
testHarness.start(); testHarness.start();

Loading…
Cancel
Save