Skip to content

Commit

Permalink
fix: add CI test that funds accounts on testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal committed Mar 14, 2024
1 parent 4ba85ab commit 55aec55
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:
- os: windows-latest-8-cores
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
env:
CI_TESTS: true
steps:
- uses: actions/checkout@v3
- uses: stellar/actions/rust-cache@main
Expand Down
34 changes: 34 additions & 0 deletions cmd/crates/soroban-test/tests/it/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,40 @@ fn generate_key() {
);
}

#[test]
fn generate_key_on_testnet() {
if std::env::var("CI_TEST").is_err() {
return;
}
let sandbox = TestEnv::default();
sandbox
.new_assert_cmd("keys")
.arg("generate")
.arg("--rpc-url=https://soroban-testnet.stellar.org:443")
.arg("--network-passphrase=Test SDF Network ; September 2015")
.arg("test_2")
.assert()
.stdout("")
.stderr("")
.success();

sandbox
.new_assert_cmd("keys")
.arg("ls")
.assert()
.stdout(predicates::str::contains("test_2\n"));
println!(
"aa {}",
sandbox
.new_assert_cmd("keys")
.arg("address")
.arg("test_2")
.assert()
.success()
.stdout_as_str()
);
}

#[test]
fn seed_phrase() {
let sandbox = TestEnv::default();
Expand Down

0 comments on commit 55aec55

Please sign in to comment.