-
Notifications
You must be signed in to change notification settings - Fork 12
test: implementation of basic actual e2e testing for DET #598
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
base: v1.0-dev
Are you sure you want to change the base?
Changes from all commits
2274a80
1c3fcaf
c189c37
19deb64
7774b0a
e9027bf
651c93f
eaa1493
d6022c1
5910abc
178c116
f63915f
040ff48
1f40b48
d169175
aae89f0
feaf866
c0a588e
708b06d
0eec8f4
ce81106
d450704
df300c3
cab8df6
b5bcd39
fd5f0ed
ff993dc
d29b417
8cf3e12
2c1d5e6
73ba4d7
eec1655
423a325
9d2b9d3
967d201
2a4abdb
e391df7
a1092d7
53727ec
81f2a30
356450f
3214d72
cb08bed
e344b7d
3220812
dbc47c2
8eaf197
eb32e22
c3fa02b
2ba0bd8
62d8887
baa746b
0502dc2
f72efff
36c6c0f
d77c384
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| name: E2E | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
|
|
||
| jobs: | ||
| e2e: | ||
| name: End-to-end Test Journey | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 90 | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Cache Cargo registry | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.cargo/registry | ||
| ~/.cargo/git | ||
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-cargo-registry- | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: actions-rs/toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
| override: true | ||
|
|
||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y build-essential pkg-config clang cmake libsqlite3-dev ca-certificates | ||
|
|
||
| - name: Install protoc | ||
| run: | | ||
| curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v25.2/protoc-25.2-linux-x86_64.zip | ||
| sudo unzip -o protoc-25.2-linux-x86_64.zip -d /usr/local bin/protoc | ||
| sudo unzip -o protoc-25.2-linux-x86_64.zip -d /usr/local 'include/*' | ||
| rm -f protoc-25.2-linux-x86_64.zip | ||
|
|
||
| - name: Prepare app configuration | ||
| run: | | ||
| mkdir -p "$HOME/.config/dash-evo-tool" | ||
| cp .env.example "$HOME/.config/dash-evo-tool/.env" | ||
|
|
||
| - name: Run E2E test journey | ||
| env: | ||
| E2E_WALLET_MNEMONIC: ${{ secrets.E2E_WALLET_MNEMONIC }} | ||
| E2E_SPV_TIMEOUT_SECS: 900 | ||
| RUST_BACKTRACE: 1 | ||
| run: | | ||
| if [ -z "${E2E_WALLET_MNEMONIC}" ]; then | ||
| echo "::warning::E2E_WALLET_MNEMONIC is not set; skipping E2E test job." | ||
| exit 0 | ||
| fi | ||
|
|
||
| cargo test --features="e2e" --test e2e -- --ignored --nocapture | tee /tmp/e2e.log | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use Line 67 calls 🔧 Proposed fix- cargo test --features="e2e" --test e2e -- --ignored --nocapture | tee /tmp/e2e.log
+ scripts/safe-cargo.sh test --test e2e --all-features -- --ignored --nocapture | tee /tmp/e2e.logAs per coding guidelines: "Use 🤖 Prompt for AI Agents |
||
|
|
||
| - name: Upload E2E log | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: e2e-test-log | ||
| path: /tmp/e2e.log | ||
| if-no-files-found: warn | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,13 +87,30 @@ raw-cpuid = "11.5.0" | |
|
|
||
| [features] | ||
| testing = [] | ||
| e2e = [] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, let's look at the Cargo.toml file, specifically around the lines mentioned
cat -n Cargo.toml | sed -n '85,120p'Repository: dashpay/dash-evo-tool Length of output: 1908 🏁 Script executed: # Search for any usage of #[cfg(feature = "e2e")] in the codebase
rg '#\[cfg\(feature\s*=\s*"e2e"' -A 2Repository: dashpay/dash-evo-tool Length of output: 979 🏁 Script executed: # Also search for cfg! macro usage with e2e feature
rg 'cfg!\s*\(\s*feature\s*=\s*"e2e"' -A 2Repository: dashpay/dash-evo-tool Length of output: 47 Whitelist the new The codebase uses Proposed fix [lints.rust.unexpected_cfgs]
level = "warn"
-check-cfg = ["cfg(tokio_unstable)", "cfg(feature, values(\"testing\"))"]
+check-cfg = ["cfg(tokio_unstable)", "cfg(feature, values(\"testing\", \"e2e\"))"]🤖 Prompt for AI Agents |
||
|
|
||
| [dev-dependencies] | ||
| egui_kittest = { version = "0.33.3", features = ["eframe"] } | ||
|
|
||
| [build-dependencies] | ||
| winres = "0.1" | ||
|
|
||
| [patch."https://github.com/dashpay/rust-dashcore"] | ||
| dash-network = { git = "https://www.github.com/dashpay/rust-dashcore", rev = "6affdaa5db30c04f533cfac4a81b9939d1cf2545" } | ||
| dash-spv = { git = "https://www.github.com/dashpay/rust-dashcore", rev = "6affdaa5db30c04f533cfac4a81b9939d1cf2545" } | ||
| dashcore = { git = "https://www.github.com/dashpay/rust-dashcore", rev = "6affdaa5db30c04f533cfac4a81b9939d1cf2545" } | ||
| dashcore-private = { git = "https://www.github.com/dashpay/rust-dashcore", rev = "6affdaa5db30c04f533cfac4a81b9939d1cf2545" } | ||
| dashcore-rpc = { git = "https://www.github.com/dashpay/rust-dashcore", rev = "6affdaa5db30c04f533cfac4a81b9939d1cf2545" } | ||
| dashcore-rpc-json = { git = "https://www.github.com/dashpay/rust-dashcore", rev = "6affdaa5db30c04f533cfac4a81b9939d1cf2545" } | ||
| dashcore_hashes = { git = "https://www.github.com/dashpay/rust-dashcore", rev = "6affdaa5db30c04f533cfac4a81b9939d1cf2545" } | ||
| key-wallet = { git = "https://www.github.com/dashpay/rust-dashcore", rev = "6affdaa5db30c04f533cfac4a81b9939d1cf2545" } | ||
| key-wallet-manager = { git = "https://www.github.com/dashpay/rust-dashcore", rev = "6affdaa5db30c04f533cfac4a81b9939d1cf2545" } | ||
|
|
||
| [[test]] | ||
| name = "e2e" | ||
| path = "tests/e2e/main.rs" | ||
| required-features = ["e2e"] | ||
|
|
||
| [lints.rust.unexpected_cfgs] | ||
| level = "warn" | ||
| check-cfg = ["cfg(tokio_unstable)", "cfg(feature, values(\"testing\"))"] | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| use dash_evo_tool::model::wallet::WalletSeedHash; | ||
| use dash_sdk::platform::Identifier; | ||
|
|
||
| /// Shared test state persisted across phases within a single test run. | ||
| /// Replaces the react-native test-context.ts JSON file approach. | ||
| pub struct TestContext { | ||
| pub wallet_seed_hash: Option<WalletSeedHash>, | ||
| pub receive_address: Option<String>, | ||
| pub balance_duffs: u64, | ||
| pub spv_synced: bool, | ||
| pub network: String, | ||
| pub wallet_reused: bool, | ||
| /// Identity ID created in Phase 5 | ||
| pub identity_id: Option<Identifier>, | ||
| /// DPNS name registered in Phase 6 | ||
| pub dpns_name: Option<String>, | ||
| /// SPV header height at setup completion (needed for tx lock time) | ||
| pub header_height: u32, | ||
| } | ||
|
|
||
| impl TestContext { | ||
| /// Returns the wallet seed hash, panicking if not yet set. | ||
| pub fn seed_hash(&self) -> &WalletSeedHash { | ||
| self.wallet_seed_hash | ||
| .as_ref() | ||
| .expect("wallet_seed_hash must be set (did Phase 0 complete?)") | ||
| } | ||
| } | ||
|
|
||
| impl Default for TestContext { | ||
| fn default() -> Self { | ||
| Self { | ||
| wallet_seed_hash: None, | ||
| receive_address: None, | ||
| balance_duffs: 0, | ||
| spv_synced: false, | ||
| network: "testnet".to_string(), | ||
| wallet_reused: false, | ||
| identity_id: None, | ||
| dpns_name: None, | ||
| header_height: 0, | ||
| } | ||
| } | ||
| } | ||
|
|
||
| /// Format first 4 bytes of a seed hash as a hex prefix string. | ||
| pub fn seed_hash_prefix(hash: &WalletSeedHash) -> String { | ||
| hash[..4].iter().map(|b| format!("{:02x}", b)).collect() | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
actions-rs/toolchain@v1 deprecated incompatible GitHub Actions runners 2024 2025💡 Result:
actions-rs/toolchain@v1is an archived/unmaintained action (repo archived Oct 13, 2023) so it has not been updated for runner-runtime changes. [1]action.ymldeclaresruns: using: 'node12', meaning it depends on the Node 12 JavaScript action runtime. [2]ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION). This is whyactions-rs/toolchain@v1started triggering deprecation warnings / breakage on newer runners. [3]What to do instead: migrate off
actions-rs/toolchain@v1to a maintained Rust toolchain installer such asdtolnay/rust-toolchain. [6]Sources: [1] [2] [3] [4] [5] [6]
🌐 Web query:
dtolnay rust-toolchain GitHub Actions recommended replacement for actions-rs💡 Result:
The commonly recommended replacement for the deprecated
actions-rs/toolchainaction isdtolnay/rust-toolchain. (github.com)Example:
dtolnay/rust-toolchaininstalls Rust viarustup, and you can addcomponents/targetsvia inputs if needed. (github.com)Citations:
Replace
actions-rs/toolchain@v1withdtolnay/rust-toolchain@stable.The
actions-rs/toolchainrepository was archived on October 13, 2023 and relies on the Node 12 JavaScript action runtime. GitHub Actions removed support for Node 12 on November 12, 2024, causing this action to fail on current runners. Use the maintaineddtolnay/rust-toolchain@stableaction instead:🧰 Tools
🪛 actionlint (1.7.11)
[error] 34-34: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🤖 Prompt for AI Agents