Skip to content

Commit

Permalink
fix: use salt for sim test and separate CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal committed Dec 9, 2024
1 parent 7537edb commit 2d22fb4
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 42 deletions.
85 changes: 43 additions & 42 deletions .github/workflows/rpc-tests.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,49 @@
name: RPC Tests
on:
push:
branches: [main, release/**]
pull_request:
push:
branches: [main, release/**]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}
cancel-in-progress: true

jobs:
test:
name: test RPC
runs-on: ubuntu-22.04
services:
rpc:
image: stellar/quickstart:testing
ports:
- 8000:8000
env:
ENABLE_LOGS: true
ENABLE_SOROBAN_DIAGNOSTIC_EVENTS: true
NETWORK: local
PROTOCOL_VERSION: 22
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
--health-timeout 5s
--health-retries 50
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: rustup update
- run: rustup target add wasm32-unknown-unknown
- run: make build-test-wasms
- name: install libudev-dev
run: |
sudo apt install -y libudev-dev
- run: cargo build --features emulator-tests
- run: SOROBAN_PORT=8000 cargo test --features it --features emulator-tests --package soroban-test --test it -- integration
test:
name: test RPC
runs-on: ubuntu-22.04
services:
rpc:
image: stellar/quickstart:testing
ports:
- 8000:8000
env:
ENABLE_LOGS: true
ENABLE_SOROBAN_DIAGNOSTIC_EVENTS: true
NETWORK: local
PROTOCOL_VERSION: 22
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
--health-timeout 5s
--health-retries 50
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: rustup update
- run: rustup target add wasm32-unknown-unknown
- run: make build-test-wasms
- name: install libudev-dev
run: |
sudo apt install -y libudev-dev
- run: cargo build --features emulator-tests
- run: SOROBAN_PORT=8000 cargo test --features it --package soroban-test --test it -- integration
- run: SOROBAN_PORT=8000 cargo test --features it --features emulator-tests --package soroban-test --test it -- integration::emulator
3 changes: 3 additions & 0 deletions cmd/crates/soroban-test/tests/it/integration/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ mod operations;
#[tokio::test]
async fn simulate() {
let sandbox = &TestEnv::new();
let salt = Some(String::from("A"));
let xdr_base64_build_only = deploy_contract(
sandbox,
HELLO_WORLD,
DeployOptions {
kind: DeployKind::BuildOnly,
salt: salt.clone(),
..Default::default()
},
)
Expand All @@ -23,6 +25,7 @@ async fn simulate() {
HELLO_WORLD,
DeployOptions {
kind: DeployKind::SimOnly,
salt: salt.clone(),
..Default::default()
},
)
Expand Down

0 comments on commit 2d22fb4

Please sign in to comment.