diff --git a/integration_test/.env.current b/integration_test/.env.current index 9b9d806e..29a7fa4b 100644 --- a/integration_test/.env.current +++ b/integration_test/.env.current @@ -1,2 +1,5 @@ -export OCTEZ_VERSION=${ARCH}_v16.1 -export PROTOCOL=Mumbai +export OCTEZ_VERSION=${ARCH}_v17.3 +export PROTOCOL=Nairobi +export SET_DEPOSITS_LIMIT=true +export ATTESTATION=endorsement +export PREATTESTATION=preendorsement diff --git a/integration_test/.env.next b/integration_test/.env.next index 776740fd..5ab96e0f 100644 --- a/integration_test/.env.next +++ b/integration_test/.env.next @@ -1,2 +1,5 @@ -export OCTEZ_VERSION=${ARCH}_v17.2 -export PROTOCOL=Nairobi +export OCTEZ_VERSION=${ARCH}_v18.0-rc1 +export PROTOCOL=Oxford +export SET_DEPOSITS_LIMIT=false +export ATTESTATION=attestation +export PREATTESTATION=preattestation diff --git a/integration_test/docker-compose.yml b/integration_test/docker-compose.yml index e2000af9..a103f5e4 100644 --- a/integration_test/docker-compose.yml +++ b/integration_test/docker-compose.yml @@ -18,10 +18,10 @@ services: command: sigybox $PROTOCOL healthcheck: test: "curl --fail http://localhost:20000/chains/main/blocks/head/header || exit 1" - interval: 1s - timeout: 1s - retries: 10 - start_period: 1s + interval: 10s + timeout: 10s + retries: 20 + start_period: 10s flextesanobaking: container_name: flextesanobaking @@ -38,10 +38,10 @@ services: command: sigybox $PROTOCOL healthcheck: test: "curl --fail http://localhost:20000/chains/main/blocks/head/header || exit 1" - interval: 1s - timeout: 1s - retries: 10 - start_period: 1s + interval: 10s + timeout: 10s + retries: 20 + start_period: 10s octez: container_name: octez diff --git a/integration_test/operationkinds_test.go b/integration_test/operationkinds_test.go index f0304108..5c89d7d9 100644 --- a/integration_test/operationkinds_test.go +++ b/integration_test/operationkinds_test.go @@ -2,6 +2,7 @@ package integrationtest import ( "log" + "os" "testing" "github.com/stretchr/testify/assert" @@ -42,7 +43,7 @@ var testcases = []testCase{ account: account, allowPolicy: map[string][]string{"generic": {"preendorsement"}, "preendorsement": {}}, notAllowPolicy: map[string][]string{"generic": getAllOpsExcluding([]string{"preendorsement"}), "endorsement": {}, "block": {}}, - successMessage: "injected preendorsement", + successMessage: "injected ", }, { kind: "endorsement", @@ -52,7 +53,7 @@ var testcases = []testCase{ account: account, allowPolicy: map[string][]string{"generic": {"endorsement"}, "endorsement": {}}, notAllowPolicy: map[string][]string{"generic": getAllOpsExcluding([]string{"endorsement"}), "preendorsement": {}, "block": {}}, - successMessage: "injected endorsement", + successMessage: "injected ", }, { kind: "block", @@ -151,6 +152,20 @@ func TestOperationAllowPolicy(t *testing.T) { defer clean_tezos_folder() for _, test := range testcases { t.Run(test.kind, func(t *testing.T) { + //while we are testing Nairobi and Oxford at the same time we have conditional for set_deposits_limit + //when we are testing O and P at the same time, we can remove this conditional and the env var + //set_deposits_limit is not a valid operation in O + if os.Getenv("SET_DEPOSITS_LIMIT") == "false" && test.kind == "set_deposits_limit" { + return + } + //likewise, when we stop testing N, we can get rid of the next 2 conditionals + if test.kind == "endorsement" { + test.successMessage = test.successMessage + os.Getenv("ATTESTATION") + } + if test.kind == "preendorsement" { + test.successMessage = test.successMessage + os.Getenv("PREATTESTATION") + } + //first, do any setup steps that have to happen before the operation to be tested for _, setupOp := range test.testSetupOps { out, err := OctezClient(setupOp...) @@ -189,7 +204,7 @@ func TestOperationAllowPolicy(t *testing.T) { log.Println("error received: " + err.Error() + " " + string(out)) } assert.NoError(t, err) - assert.Contains(t, string(out), test.successMessage) + require.Contains(t, string(out), test.successMessage) metrics2 := GetMetrics(test.account, test.kind, test.op, vault) AssertMetricsSuccessIncremented(t, metrics1, metrics2, test.op) }) diff --git a/integration_test/speculos.go b/integration_test/speculos.go index 5775ea61..1841c563 100644 --- a/integration_test/speculos.go +++ b/integration_test/speculos.go @@ -3,7 +3,6 @@ package integrationtest import ( "bytes" "encoding/json" - "fmt" "io" "net/http" "strings" @@ -61,7 +60,6 @@ func getScreenText() string { if err != nil { panic(err) } - fmt.Println(string(bytes)) return string(bytes) }