Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
394e059
Stub file that normally comes from native builds for running tests
danrmiller Apr 22, 2026
5081cee
Debug test workflow
danrmiller Apr 22, 2026
a58ba98
Debug test workflow
danrmiller Apr 22, 2026
214573a
fix configure app step to surface real failures
danrmiller Apr 22, 2026
07e3160
install required rust toolchain
danrmiller Apr 22, 2026
70c462b
install required rust toolchains
danrmiller Apr 22, 2026
1f012bf
Uncomment broken electrumx test for eventual updating
danrmiller Apr 22, 2026
8aa9af2
Update deprecated action
danrmiller Apr 22, 2026
8851b63
Format electrumx_test.dart
danrmiller Apr 22, 2026
2b22fe5
Remove broken electrumx test
danrmiller Apr 22, 2026
d25f347
ci: add openjdk-8-jre-headless and libc6-dev-i386 to apt deps
sneurlax Apr 22, 2026
5ef089d
ci: replace powershell secret injection with prebuild.sh and build_ru…
sneurlax Apr 22, 2026
ca6f5ea
ci: downgrade codecov-action to v1.2.2 and simplify test command
sneurlax Apr 22, 2026
5b0abd8
fix: add testNodeConnectionProvider riverpod wrapper for node tests
sneurlax Apr 22, 2026
2539ea4
fix: update node views and widgets to use testNodeConnectionProvider
sneurlax Apr 22, 2026
82bb378
fix: improve logger dispatch fallback error output
sneurlax Apr 22, 2026
2bb1362
chore: remove stale generated isar model
sneurlax Apr 22, 2026
40f3587
chore: remove stale mock files
sneurlax Apr 23, 2026
31d7ead
chore: update pubspec.lock with test dependencies
sneurlax Apr 23, 2026
42b2891
test: add hive_ce_test_utils in-memory adapter helper
sneurlax Apr 23, 2026
215e5fa
test: add mock_electrum_server for electrumx unit tests
sneurlax Apr 23, 2026
6ca29c1
test: add platform_test_overrides cross-platform support helper
sneurlax Apr 23, 2026
1d319a9
test: restore electrumx_test with in-memory adapter harness
sneurlax Apr 23, 2026
f74389b
test: update cached_electrumx_test for current api
sneurlax Apr 23, 2026
0e94bdb
test: update node_service_test for current api
sneurlax Apr 23, 2026
3d4f6d5
test: update lockscreen_view_screen_test for current api
sneurlax Apr 23, 2026
2149f7c
test: update create_pin_view_screen_test for current api
sneurlax Apr 23, 2026
f38f5e1
test: update change_now_test for current api
sneurlax Apr 23, 2026
7857ccb
test: update firo_wallet_test for current api
sneurlax Apr 23, 2026
2a8f441
test: update node_card_test for current api
sneurlax Apr 23, 2026
9db6ddb
test: update node_options_sheet_test for current api
sneurlax Apr 23, 2026
685b195
test: update price_test for current api
sneurlax Apr 23, 2026
91d0be6
test: update utility tests for current api
sneurlax Apr 23, 2026
fd03de7
create lib/external_api_keys.dart via bash base64 instead of previous…
danrmiller Apr 23, 2026
73244d3
Run prebuild from expected directory
danrmiller Apr 23, 2026
ac42044
Run prebuild from expected directory
danrmiller Apr 23, 2026
bccd6c1
Format changed tests
danrmiller Apr 23, 2026
578b5ca
feat: ensure app_config.g.dart exists for CI
sneurlax Apr 23, 2026
cc86188
test: add diagnostics to tests
sneurlax Apr 23, 2026
162c10d
test: fix changenow test to explicitly pass an invalid api key
sneurlax Apr 23, 2026
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
126 changes: 51 additions & 75 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Prepare repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install Flutter
Expand All @@ -25,9 +25,10 @@ jobs:
- name: install dependencies
run: |
cargo install cargo-ndk
rustup target add x86_64-unknown-linux-gnu
rustup install 1.85.1 1.89.0
rustup target add x86_64-unknown-linux-gnu --toolchain 1.89.0
sudo apt update
sudo apt install -y meson ninja-build libglib2.0-dev libgcrypt20-dev libgirepository1.0-dev unzip automake build-essential file pkg-config git python3 libtool cmake openjdk-8-jre-headless libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev llvm debhelper libclang-dev opencl-headers libssl-dev ocl-icd-opencl-dev libc6-dev-i386
sudo apt install -y meson ninja-build libglib2.0-dev libgcrypt20-dev libgirepository1.0-dev unzip automake build-essential file pkg-config git python3 libtool cmake openjdk-8-jre-headless libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev llvm debhelper libclang-dev opencl-headers libssl-dev ocl-icd-opencl-dev libc6-dev-i386 valac libtss2-dev
# - name: Build Epic Cash
#run: |
#cd crypto_plugins/flutter_libepiccash/scripts/linux/
Expand All @@ -36,65 +37,39 @@ jobs:
- name: Configure app
run: |
cd scripts
yes yes | ./build_app.sh -v "0.0.1" -b "1" -p "linux" -a "stack_wallet" || true
echo "yes" | ./build_app.sh -v "0.0.1" -b "1" -p "linux" -a "stack_wallet"

- name: Get dependencies
run: flutter pub get

- name: Create temp files
id: secret-file1
- name: Create git_versions.dart stubs
run: |
$secretFileExchange = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "lib/external_api_keys.dart";
$encodedBytes = [System.Convert]::FromBase64String($env:CHANGE_NOW);
Set-Content $secretFileExchange -Value $encodedBytes -AsByteStream;
$secretFileExchangeHash = Get-FileHash $secretFileExchange;
Write-Output "Secret file $secretFileExchange has hash $($secretFileExchangeHash.Hash)";

$secretFileBitcoin = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/bitcoin/bitcoin_wallet_test_parameters.dart";
$encodedBytes = [System.Convert]::FromBase64String($env:BITCOIN_TEST);
Set-Content $secretFileBitcoin -Value $encodedBytes -AsByteStream;
$secretFileBitcoinHash = Get-FileHash $secretFileBitcoin;
Write-Output "Secret file $secretFileBitcoin has hash $($secretFileBitcoinHash.Hash)";

$secretFileDogecoin = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/dogecoin/dogecoin_wallet_test_parameters.dart";
$encodedBytes = [System.Convert]::FromBase64String($env:DOGECOIN_TEST);
Set-Content $secretFileDogecoin -Value $encodedBytes -AsByteStream;
$secretFileDogecoinHash = Get-FileHash $secretFileDogecoin;
Write-Output "Secret file $secretFileDogecoin has hash $($secretFileDogecoinHash.Hash)";

$secretFileFiro = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/firo/firo_wallet_test_parameters.dart";
$encodedBytes = [System.Convert]::FromBase64String($env:FIRO_TEST);
Set-Content $secretFileFiro -Value $encodedBytes -AsByteStream;
$secretFileFiroHash = Get-FileHash $secretFileFiro;
Write-Output "Secret file $secretFileFiro has hash $($secretFileFiroHash.Hash)";

$secretFileBitcoinCash = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/bitcoincash/bitcoincash_wallet_test_parameters.dart";
$encodedBytes = [System.Convert]::FromBase64String($env:BITCOINCASH_TEST);
Set-Content $secretFileBitcoinCash -Value $encodedBytes -AsByteStream;
$secretFileBitcoinCashHash = Get-FileHash $secretFileBitcoinCash;
Write-Output "Secret file $secretFileBitcoinCash has hash $($secretFileBitcoinCashHash.Hash)";

$secretFileNamecoin = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/namecoin/namecoin_wallet_test_parameters.dart";
$encodedBytes = [System.Convert]::FromBase64String($env:NAMECOIN_TEST);
Set-Content $secretFileNamecoin -Value $encodedBytes -AsByteStream;
$secretFileNamecoinHash = Get-FileHash $secretFileNamecoin;
Write-Output "Secret file $secretFileNamecoin has hash $($secretFileNamecoinHash.Hash)";

$secretFileParticl = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/particl/particl_wallet_test_parameters.dart";
$encodedBytes = [System.Convert]::FromBase64String($env:PARTICL_TEST);
Set-Content $secretFileParticl -Value $encodedBytes -AsByteStream;
$secretFileParticlHash = Get-FileHash $secretFileParticl;
Write-Output "Secret file $secretFileParticl has hash $($secretFileParticlHash.Hash)";

shell: pwsh
mkdir -p crypto_plugins/flutter_libepiccash/lib
mkdir -p crypto_plugins/flutter_libmwc/lib

cat > crypto_plugins/flutter_libepiccash/lib/git_versions.dart << 'EOF'
String getPluginVersion() => "stub-for-tests";
EOF

cat > crypto_plugins/flutter_libmwc/lib/git_versions.dart << 'EOF'
String getPluginVersion() => "stub-for-tests";
EOF

- name: Decode secrets
env:
CHANGE_NOW: ${{ secrets.CHANGE_NOW }}
BITCOIN_TEST: ${{ secrets.BITCOIN_TEST }}
DOGECOIN_TEST: ${{ secrets.DOGECOIN_TEST }}
FIRO_TEST: ${{ secrets.FIRO_TEST }}
BITCOINCASH_TEST: ${{ secrets.BITCOINCASH_TEST }}
NAMECOIN_TEST: ${{ secrets.NAMECOIN_TEST }}
PARTICL_TEST: ${{ secrets.PARTICL_TEST }}
run: |
echo "$CHANGE_NOW" | base64 --decode > lib/external_api_keys.dart

- name: Ensure app config for tests
run: bash scripts/ensure_test_app_config.sh

- name: Create test stubs
run: bash prebuild.sh
working-directory: scripts

- name: Regenerate mocks
run: dart run build_runner build --delete-conflicting-outputs

- name: Check formatting of changed files
run: |
Expand All @@ -114,29 +89,30 @@ jobs:
# - name: Analyze
# run: flutter analyze
- name: Test
run: flutter test --coverage
run: |
set -o pipefail
mkdir -p build/test-results
bash scripts/ensure_test_app_config.sh
test -s lib/app_config.g.dart
grep -Fq "part of 'app_config.dart';" lib/app_config.g.dart
flutter test --coverage \
--reporter failures-only \
--file-reporter json:build/test-results/flutter-test.json \
2>&1 | tee build/test-results/flutter-test.log
- name: Print failed test names
if: failure()
run: node scripts/dev/print_failed_flutter_tests.js build/test-results/flutter-test.json
- name: Upload Flutter test results
uses: actions/upload-artifact@v7
if: always()
with:
name: flutter-test-results-${{ github.run_id }}-${{ github.run_attempt }}
path: build/test-results/
if-no-files-found: warn
retention-days: 7
- name: Upload to code coverage
uses: codecov/codecov-action@v1.2.2
if: success() || failure()
with:
token: ${{secrets.CODECOV_TOKEN}}
file: coverage/lcov.info
- name: Delete temp files
run: |
$secretFileExchange = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "lib/external_api_keys.dart";
$secretFileBitcoin = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/bitcoin/bitcoin_wallet_test_parameters.dart";
$secretFileDogecoin = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/dogecoin/dogecoin_wallet_test_parameters.dart";
$secretFileFiro = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/firo/firo_wallet_test_parameters.dart";
$secretFileBitcoinCash = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/bitcoincash/bitcoincash_wallet_test_parameters.dart";
$secretFileNamecoin = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/namecoin/namecoin_wallet_test_parameters.dart";
$secretFileParticl = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "test/services/coins/particl/particl_wallet_test_parameters.dart";

Remove-Item -Path $secretFileExchange;
Remove-Item -Path $secretFileBitcoin;
Remove-Item -Path $secretFileDogecoin;
Remove-Item -Path $secretFileFiro;
Remove-Item -Path $secretFileBitcoinCash;
Remove-Item -Path $secretFileNamecoin;
Remove-Item -Path $secretFileParticl;
shell: pwsh
if: always()
Loading
Loading