Skip to content

Commit bb3cd9b

Browse files
committed
ci(payjoin): isolate funded testnet fixture
1 parent 30ab417 commit bb3cd9b

2 files changed

Lines changed: 16 additions & 9 deletions

File tree

.github/workflows/analyze_and_test.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ on:
1616
- '.gitignore'
1717
- '.git-blame-ignore-revs'
1818
- '.github/ISSUE_TEMPLATE/**'
19+
# The funded Payjoin fixture spends from shared testnet wallets. It does not
20+
# run for the concurrent develop stack; workflow_dispatch lets a reviewer run
21+
# it for an arbitrary branch.
22+
workflow_dispatch:
1923

2024
# Checkout + tests only; no writes to the repo via the token.
2125
permissions:
@@ -169,6 +173,10 @@ jobs:
169173
env:
170174
TEST_ALICE_MNEMONIC: ${{ secrets.ENV_TEST_ALICE_MNEMONIC }}
171175
TEST_BOB_MNEMONIC: ${{ secrets.ENV_TEST_BOB_MNEMONIC }}
176+
# The fixture spends from these two shared wallets. It runs as a final
177+
# delivery gate on PRs to main, rather than for every develop PR in a
178+
# stack, and can still be run manually for an arbitrary branch.
179+
RUN_FUNDED_PAYJOIN_TEST: ${{ github.base_ref == 'main' || github.event_name == 'workflow_dispatch' }}
172180
SCCACHE_GHA_ENABLED: "true"
173181
RUSTC_WRAPPER: sccache
174182
# sccache cannot cache incremental compilation artifacts; disabling

integration_test/payjoin_test.dart

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,10 @@ Future<void> main({bool isInitialized = false}) async {
103103
receiverMnemonic != null &&
104104
receiverMnemonic.isNotEmpty &&
105105
senderMnemonic != null &&
106-
senderMnemonic.isNotEmpty;
106+
senderMnemonic.isNotEmpty &&
107+
Platform.environment['RUN_FUNDED_PAYJOIN_TEST'] == 'true';
107108
const fixtureSkip =
108-
'requires TEST_ALICE_MNEMONIC and TEST_BOB_MNEMONIC (funded testnet wallets)';
109+
'requires a PR to main or a manually dispatched CI run with funded testnet wallets';
109110

110111
// Belongs to this file's own Bull.init above, not to the fixtures, so it
111112
// stays at the root scope and runs even when the funded group is skipped.
@@ -150,13 +151,11 @@ Future<void> main({bool isInitialized = false}) async {
150151
// are individually skipped still runs its setUpAll and tearDownAll, whereas
151152
// a skipped group runs neither. Verified against package:test 1.31.
152153
//
153-
// That distinction is what made every fork PR red. GitHub withholds secrets
154-
// from pull_request runs on forks, so TEST_ALICE_MNEMONIC/TEST_BOB_MNEMONIC
155-
// expand to the empty string — set but empty. The tests below skipped
156-
// correctly, yet this setUpAll still ran, and createFromMnemonic rejected a
157-
// 1-word mnemonic. Because gen_all_test.dart calls each file's main()
158-
// without wrapping it in a group, the failure landed on the root scope of
159-
// the aggregated suite and took down the whole integration job.
154+
// This also keeps shared funded wallets out of concurrent pull-request jobs.
155+
// Every such job otherwise derives the same BIP84 account and broadcasts
156+
// consolidation transactions from the same UTXOs, causing RBF conflicts.
157+
// The workflow enables this group for delivery PRs to main or manual runs,
158+
// not for every branch in a concurrent develop stack.
160159
//
161160
// Scoping the hooks to the group also stops them leaking into the other
162161
// seven aggregated files, which previously inherited this setUp and paid a

0 commit comments

Comments
 (0)