Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into js-rename
Browse files Browse the repository at this point in the history
  • Loading branch information
sreuland committed Nov 1, 2023
2 parents 62f8c37 + a16998b commit 0808020
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/Dockerfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ env:
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
# the only time system test image needs to be defined for a push is when it's a non 'v' tag creation
PUSH_ENABLED: ${{ secrets.DOCKERHUB_TOKEN && github.ref_type == 'tag' && startsWith(github.ref_name, 'v') != true && 'true' || 'false' }}
IMAGE: ${{ format('{0}/{1}:{2}', secrets.DOCKERHUB_TOKEN && 'docker.io' || 'ghcr.io', github.repository, github.event.ref || 'latest') }}
IMAGE: ${{ format('{0}/{1}:{2}', secrets.DOCKERHUB_TOKEN && 'docker.io' || 'ghcr.io', github.repository, github.ref_type == 'tag' && github.ref_name || github.event.ref || 'latest') }}
CORE_GIT_REF: https://github.com/stellar/stellar-core.git#master
CORE_COMPILE_CONFIGURE_FLAGS: "--disable-tests --enable-next-protocol-version-unsafe-for-production"
CORE_COMPILE_CONFIGURE_FLAGS: "--disable-tests"
SOROBAN_RPC_GIT_REF: https://github.com/stellar/soroban-tools.git#main
RUST_TOOLCHAIN_VERSION: stable
SOROBAN_CLI_GIT_REF: https://github.com/stellar/soroban-tools.git#main
QUICKSTART_GIT_REF: https://github.com/stellar/quickstart.git#master
JS_SOROBAN_CLIENT_NPM_VERSION: https://github.com/stellar/js-soroban-client.git#main
jobs:
complete:
if: always()
Expand All @@ -50,6 +51,7 @@ jobs:
RUST_TOOLCHAIN_VERSION=${{ env.RUST_TOOLCHAIN_VERSION }} \
SOROBAN_CLI_GIT_REF=${{ env.SOROBAN_CLI_GIT_REF }} \
SYSTEM_TEST_IMAGE=${{ env.PUSH_ENABLED == 'true' && env.IMAGE || 'stellar/system-test:dev' }} \
JS_SOROBAN_CLIENT_NPM_VERSION=${{ env.JS_SOROBAN_CLIENT_NPM_VERSION }} \
QUICKSTART_GIT_REF=${{ env.QUICKSTART_GIT_REF }} build;
- if: ${{ env.PUSH_ENABLED == 'true' }}
name: Save Docker Image to file
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,15 @@ The docker run follows standard exit code conventions, so if all tests pass in t
#### Running Test Examples
- Run tests against an instance of core and rpc on a local network all running in the test container:


```
docker run --rm -t --name e2e_test stellar/system-test:<tag> \
--VerboseOutput true
```

- Run tests against a remote instance of rpc configured for testnet, this will not run core or rpc instances locally in the test container. It requires you provide a key pair of an account that is funded with Lumens on the target network for the tests to use as source account on transactions it will submit to target network:


```
docker run --rm -t --name e2e_test stellar/system-test:<tag> \
--VerboseOutput true \
Expand Down
15 changes: 11 additions & 4 deletions features/dapp_develop/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,25 @@ func compileContract(contractExamplesSubPath string, contractWorkingDirectory st
func deployContract(compiledContractFileName string, contractWorkingDirectory string, contractExamplesSubPath string, installedContractId string, e2eConfig *e2e.E2EConfig) (string, error) {
var envCmd *cmd.Cmd

// Always use --ignore-checks since system-test will use contracts compiled with RC versions of the Soroban Rust SDK.
if installedContractId != "" {
envCmd = cmd.NewCmd("soroban",
"contract",
"deploy",
"--wasm-hash", installedContractId,
"--rpc-url", e2eConfig.TargetNetworkRPCURL,
"--source", e2eConfig.TargetNetworkSecretKey,
"--network-passphrase", e2eConfig.TargetNetworkPassPhrase)
"--network-passphrase", e2eConfig.TargetNetworkPassPhrase,
"--ignore-checks")
} else {
envCmd = cmd.NewCmd("soroban",
"contract",
"deploy",
"--wasm", fmt.Sprintf("./%s/%s/target/wasm32-unknown-unknown/release/%s", contractWorkingDirectory, contractExamplesSubPath, compiledContractFileName),
"--rpc-url", e2eConfig.TargetNetworkRPCURL,
"--source", e2eConfig.TargetNetworkSecretKey,
"--network-passphrase", e2eConfig.TargetNetworkPassPhrase)
"--network-passphrase", e2eConfig.TargetNetworkPassPhrase,
"--ignore-checks")
}

status, stdOut, err := e2e.RunCommand(envCmd, e2eConfig)
Expand All @@ -74,12 +77,14 @@ func deployContract(compiledContractFileName string, contractWorkingDirectory st
}

func deployContractUsingConfigParams(compiledContractFileName string, contractWorkingDirectory string, contractExamplesSubPath string, identityName string, networkConfigName string, e2eConfig *e2e.E2EConfig) (string, error) {
// Always use --ignore-checks since system-test will use contracts compiled with RC versions of the Soroban Rust SDK.
envCmd := cmd.NewCmd("soroban",
"contract",
"deploy",
"--wasm", fmt.Sprintf("./%s/%s/target/wasm32-unknown-unknown/release/%s", contractWorkingDirectory, contractExamplesSubPath, compiledContractFileName),
"--network", networkConfigName,
"--source", identityName)
"--source", identityName,
"--ignore-checks")

status, stdOut, err := e2e.RunCommand(envCmd, e2eConfig)

Expand All @@ -96,13 +101,15 @@ func deployContractUsingConfigParams(compiledContractFileName string, contractWo

// returns the installed contract id
func installContract(compiledContractFileName string, contractWorkingDirectory string, contractExamplesSubPath string, e2eConfig *e2e.E2EConfig) (string, error) {
// Always use --ignore-checks since system-test will use contracts compiled with RC versions of the Soroban Rust SDK.
envCmd := cmd.NewCmd("soroban",
"contract",
"install",
"--wasm", fmt.Sprintf("./%s/%s/target/wasm32-unknown-unknown/release/%s", contractWorkingDirectory, contractExamplesSubPath, compiledContractFileName),
"--rpc-url", e2eConfig.TargetNetworkRPCURL,
"--source", e2eConfig.TargetNetworkSecretKey,
"--network-passphrase", e2eConfig.TargetNetworkPassPhrase)
"--network-passphrase", e2eConfig.TargetNetworkPassPhrase,
"--ignore-checks")

status, stdOut, err := e2e.RunCommand(envCmd, e2eConfig)

Expand Down

0 comments on commit 0808020

Please sign in to comment.