Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix e2e and integration tests #339

Merged
merged 4 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand All @@ -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 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be un-necessary to set at runtime, the image built in prior step should now have the proto version coded into it, and quickstart startup will just reference that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that it's not really provided during runtime. I may be wrong, but can you point to were it's provided?

It is provided during build time, but AFAIU, it isn't saved anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify this even further. The quickstart image does this to make the default protocol permanent https://github.com/stellar/quickstart/blob/master/Dockerfile#L55-L57 but the system-test image AFAIU doesn't do that, it just borrows the start script from quickstart.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

systest image uses the qs image as the base/parent image, and invokes the qs start script from that base layer, so the image should have DEFAULT_PROTOCOL_VERSION hard coded as an ENV per latest on qs docker file

I need to do a PR that removes DEFAULT_PROTOCOL_VERSION from the run step only and see what the system test results are.

--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 \
Expand Down
21 changes: 11 additions & 10 deletions cmd/stellar-rpc/internal/integrationtest/infrastructure/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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() + "/../../../../"
Expand All @@ -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)
}
Expand Down
9 changes: 0 additions & 9 deletions cmd/stellar-rpc/internal/integrationtest/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading