From 66e4cbd9bc31519fbe575ae7b0f4bd534d5792cd Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Fri, 13 Dec 2024 20:27:38 +0100 Subject: [PATCH 1/4] Fix e2e and integration tests --- .github/workflows/e2e.yml | 3 +-- .../integrationtest/infrastructure/test.go | 14 +++++++++++--- .../internal/integrationtest/migrate_test.go | 9 --------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 8e08f050..e0a96663 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -54,8 +54,7 @@ jobs: # system test will build quickstart image internally to use for running the service stack # configured in standalone network mode(core, rpc) - SYSTEM_TEST_QUICKSTART_GIT_REF: https://github.com/stellar/quickstart.git#1a831b2350dd3928b60eb745d0862ee19dd2aaaa - # triggers system test to log out details from quickstart's logs and test steps + SYSTEM_TEST_QUICKSTART_GIT_REF: https://github.com/stellar/quickstart.git#e1f62bf34cf047156dbb599b3c7dff52283ac696 # triggers system test to log out details from quickstart's logs and test steps SYSTEM_TEST_VERBOSE_OUTPUT: "true" # the soroban test cases will compile various contracts from the examples repo diff --git a/cmd/stellar-rpc/internal/integrationtest/infrastructure/test.go b/cmd/stellar-rpc/internal/integrationtest/infrastructure/test.go index b132b239..1cb83c87 100644 --- a/cmd/stellar-rpc/internal/integrationtest/infrastructure/test.go +++ b/cmd/stellar-rpc/internal/integrationtest/infrastructure/test.go @@ -20,6 +20,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "golang.org/x/mod/semver" "github.com/stellar/go/clients/stellarcore" "github.com/stellar/go/keypair" @@ -340,12 +341,19 @@ func (i *Test) waitForRPC() { ) } +const versionAfterStellarRPCRename = "22.1.1" + func (i *Test) generateCaptiveCoreCfgForContainer() { getOldVersionCaptiveCoreConfigVersion := func(dir string, filename string) ([]byte, error) { - // TODO: to be removed once we go over the stellar-rpc renaming + prefix := "stellar-rpc" + if semver.Compare("v"+i.rpcContainerVersion, "v"+versionAfterStellarRPCRename) < 0 { + prefix = "soroban-rpc" + } arg := fmt.Sprintf( - "v%s:./soroban-rpc/internal/integrationtest/infrastructure/%s/%s", - i.rpcContainerVersion, dir, + "v%s:./%s/internal/integrationtest/infrastructure/%s/%s", + i.rpcContainerVersion, + prefix, + dir, filename) cmd := exec.Command("git", "show", arg) cmd.Dir = GetCurrentDirectory() + "/../../../../" diff --git a/cmd/stellar-rpc/internal/integrationtest/migrate_test.go b/cmd/stellar-rpc/internal/integrationtest/migrate_test.go index ba86fa29..dc6cbff2 100644 --- a/cmd/stellar-rpc/internal/integrationtest/migrate_test.go +++ b/cmd/stellar-rpc/internal/integrationtest/migrate_test.go @@ -22,15 +22,6 @@ func TestMigrate(t *testing.T) { t.Skip("Only test this for the latest protocol: ", infrastructure.MaxSupportedProtocolVersion) } for _, originVersion := range getCurrentProtocolReleasedVersions(t) { - if originVersion == "21.1.0" { - // This version of the RPC container fails to even start with its captive core companion file - // (it fails Invalid configuration: DEPRECATED_SQL_LEDGER_STATE not set.) - continue - } - if originVersion == "21.3.0" { - // This version of RPC wasn't published as a docker container - continue - } if originVersion == "22.0.0-rc2" || originVersion == "22.0.0-rc3" { // This version of RPC wasn't published as a docker container w/ this tag continue From 158b70b84242f4b7d7fd93dac22e1de9295a4156 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Mon, 16 Dec 2024 09:29:09 +0100 Subject: [PATCH 2/4] Remove deprecated code --- .../internal/integrationtest/infrastructure/test.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/cmd/stellar-rpc/internal/integrationtest/infrastructure/test.go b/cmd/stellar-rpc/internal/integrationtest/infrastructure/test.go index 1cb83c87..938b14e5 100644 --- a/cmd/stellar-rpc/internal/integrationtest/infrastructure/test.go +++ b/cmd/stellar-rpc/internal/integrationtest/infrastructure/test.go @@ -362,13 +362,6 @@ func (i *Test) generateCaptiveCoreCfgForContainer() { // Get old version of captive-core-integration-tests.cfg.tmpl out, err := getOldVersionCaptiveCoreConfigVersion("docker", captiveCoreConfigTemplateFilename) - if err != nil { - // Try the directory before the integration test refactoring - // TODO: remove this hack after protocol 22 is released - out, err = getOldVersionCaptiveCoreConfigVersion("../../test", captiveCoreConfigFilename) - outStr := strings.Replace(string(out), `ADDRESS="localhost"`, `ADDRESS="${CORE_HOST_PORT}"`, -1) - out = []byte(outStr) - } require.NoError(i.t, err) i.generateCaptiveCoreCfg(out, inContainerCaptiveCorePort, inContainerCoreHostname) } From 38abf05d1054279cb55266cbf604e8f9ee3642c0 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Tue, 17 Dec 2024 00:29:12 +0100 Subject: [PATCH 3/4] Bump quickstart version --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index e0a96663..b8ea4b8f 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -54,7 +54,7 @@ jobs: # system test will build quickstart image internally to use for running the service stack # configured in standalone network mode(core, rpc) - SYSTEM_TEST_QUICKSTART_GIT_REF: https://github.com/stellar/quickstart.git#e1f62bf34cf047156dbb599b3c7dff52283ac696 # triggers system test to log out details from quickstart's logs and test steps + SYSTEM_TEST_QUICKSTART_GIT_REF: https://github.com/stellar/quickstart.git#8ba15a3208a892f338a5927f67f3187065517c55 # triggers system test to log out details from quickstart's logs and test steps SYSTEM_TEST_VERBOSE_OUTPUT: "true" # the soroban test cases will compile various contracts from the examples repo From 848e41b0542d6d896d58069c2896a65df4acfbdb Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Tue, 17 Dec 2024 01:20:17 +0100 Subject: [PATCH 4/4] Set default protocol version --- .github/workflows/e2e.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index b8ea4b8f..cfaab1a6 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -60,6 +60,8 @@ jobs: # the soroban test cases will compile various contracts from the examples repo SYSTEM_TEST_SOROBAN_EXAMPLES_GIT_HASH: "v21.6.0" SYSTEM_TEST_SOROBAN_EXAMPLES_GIT_REPO: "https://github.com/stellar/soroban-examples.git" + + PROTOCOL_VERSION_DEFAULT: 21 steps: - uses: actions/checkout@v4 name: checkout system-test @@ -98,6 +100,7 @@ jobs: JS_STELLAR_SDK_REF="file:/home/tester/js-stellar-sdk"; \ fi make \ + PROTOCOL_VERSION_DEFAULT=$PROTOCOL_VERSION_DEFAULT \ CORE_GIT_REF=$SYSTEM_TEST_CORE_GIT_REF \ CORE_COMPILE_CONFIGURE_FLAGS="$SYSTEM_TEST_CORE_COMPILE_CONFIGURE_FLAGS" \ CORE_IMAGE=$SYSTEM_TEST_CORE_IMAGE \ @@ -111,7 +114,8 @@ jobs: build - name: Run system test scenarios run: | - docker run --rm -t --name e2e_test stellar/system-test:dev \ + docker run -e PROTOCOL_VERSION_DEFAULT=$PROTOCOL_VERSION_DEFAULT \ + --rm -t --name e2e_test stellar/system-test:dev \ --VerboseOutput $SYSTEM_TEST_VERBOSE_OUTPUT \ --TestFilter "${{ matrix.scenario-filter }}" \ --SorobanExamplesGitHash $SYSTEM_TEST_SOROBAN_EXAMPLES_GIT_HASH \