diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 8e08f050..cfaab1a6 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -54,13 +54,14 @@ 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#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 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 @@ -99,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 \ @@ -112,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 \ diff --git a/cmd/stellar-rpc/internal/integrationtest/infrastructure/test.go b/cmd/stellar-rpc/internal/integrationtest/infrastructure/test.go index b132b239..938b14e5 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() + "/../../../../" @@ -354,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) } 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