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

chore: update e2e CI workflow to latest quickstart #969

Merged
merged 5 commits into from
May 15, 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
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# paths = ["/path/to/override"] # path dependency overrides

[alias] # command aliases
install_soroban = "install --version 20.2.0 --root ./target soroban-cli --debug"
install_soroban = "install --version 21.0.0-preview.1 --root ./target soroban-cli --debug"
# b = "build --target wasm32-unknown-unknown --release"
# c = "check"
# t = "test"
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ContractClient
name: e2e

on:
push:
Expand All @@ -7,17 +7,18 @@ on:

jobs:
test:
name: test generated ContractClient
name: test contract.Client
runs-on: ubuntu-22.04
services:
rpc:
image: stellar/quickstart:soroban-dev@sha256:0ad51035cf7caba2fd99c7c1fad0945df6932be7d5c893e1520ccdef7d6a6ffe
image: stellar/quickstart:testing@sha256:bef5c451e305c914e91964ec22e7a25b9f5276a706fe0357ac23125569d93f05
ports:
- 8000:8000
env:
ENABLE_LOGS: true
NETWORK: local
ENABLE_SOROBAN_RPC: true
PROTOCOL_VERSION: 21
options: >-
--health-cmd "curl --no-progress-meter --fail-with-body -X POST \"http://localhost:8000/soroban/rpc\" -H 'Content-Type: application/json' -d '{\"jsonrpc\":\"2.0\",\"id\":8675309,\"method\":\"getNetwork\"}' && curl --no-progress-meter \"http://localhost:8000/friendbot\" | grep '\"invalid_field\": \"addr\"'"
--health-interval 10s
Expand Down
9 changes: 8 additions & 1 deletion test/e2e/initialize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ echo "###################### Initializing e2e tests ########################"

soroban="$dirname/../../target/bin/soroban"
if [[ -f "$soroban" ]]; then
echo "Using soroban binary from ./target/bin"
current=$($soroban --version | head -n 1 | cut -d ' ' -f 2)
desired=$(cat .cargo/config.toml | grep -oE -- "--version\s+\S+" | awk '{print $2}')
if [[ "$current" != "$desired" ]]; then
echo "Current pinned soroban binary: $current. Desired: $desired. Building soroban binary."
(cd "$dirname/../.." && cargo install_soroban)
else
echo "Using soroban binary from ./target/bin"
fi
else
echo "Building pinned soroban binary"
(cd "$dirname/../.." && cargo install_soroban)
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ async function clientFor(contract, { keypair = generateFundedKeypair(), contract
keypair = await keypair // eslint-disable-line no-param-reassign
const wallet = basicNodeSigner(keypair, networkPassphrase)

const wasmHash = contracts[contract].hash;
let wasmHash = contracts[contract].hash;
if (!wasmHash) {
throw new Error(`No wasm hash found for \`contracts[${contract}]\`! ${JSON.stringify(contracts[contract], null, 2)}`)
wasmHash = spawnSync("./target/bin/soroban", ["contract", "install", "--wasm", contracts[contract].path], { shell: true, encoding: "utf8" }).stdout.trim()
}

// TODO: do this with js-stellar-sdk, instead of shelling out to the CLI
Expand Down
Binary file modified test/e2e/wasms/test_custom_types.wasm
Binary file not shown.
Binary file modified test/e2e/wasms/test_hello_world.wasm
Binary file not shown.
Binary file modified test/e2e/wasms/test_swap.wasm
Binary file not shown.
Binary file modified test/e2e/wasms/test_token.wasm
Binary file not shown.
Loading