diff --git a/scripts/ci/get_e2e_jobs.sh b/scripts/ci/get_e2e_jobs.sh index c7e9d26b55f2..f738ad0d0727 100755 --- a/scripts/ci/get_e2e_jobs.sh +++ b/scripts/ci/get_e2e_jobs.sh @@ -47,21 +47,40 @@ allow_list=( "guides_writing_an_account_contract" ) -# Add labels from input to the allow_list -IFS=',' read -r -a input_labels <<<"$LABELS" -allow_list+=("${input_labels[@]}") +# Add labels from input to the allow_list, supports prefix matching +# E.g: +# e2e_p2p label will match e2e_p2p_gossip, e2e_p2p_rediscovery, e2e_p2p_reqresp etc. +# e2e_prover label will match e2e_prover_fake_proofs, e2e_prover_coordination etc. +IFS=',' read -r -a input_labels <<< "$LABELS" +expanded_allow_list=() + +for label in "${input_labels[@]}"; do + # For each input label, find all tests that start with this prefix + matching_tests=$(echo "$full_list" | tr ' ' '\n' | grep "^${label}" || true) + + # If matching tests are found, add them to expanded_allow_list; otherwise, add the label itself + if [ -n "$matching_tests" ]; then + expanded_allow_list+=($matching_tests) + else + expanded_allow_list+=("$label") + fi +done + +# Add the input labels and expanded matches to allow_list +allow_list+=("${input_labels[@]}" "${expanded_allow_list[@]}") + # Generate full list of targets, excluding specific entries, on one line test_list=$(echo "${full_list[@]}" | grep -v 'base' | grep -v 'bench' | grep -v "network" | grep -v 'devnet' | xargs echo) -# # If branch is master or allow_list contains 'e2e-all', return full list +# If branch is master or allow_list contains 'e2e-all', return full list if [[ "$BRANCH" == "master" ]] || [[ " ${allow_list[@]} " =~ "e2e_all" ]]; then # print as JSON list echo "$test_list" | jq -Rc 'split(" ")' exit 0 fi -# # Filter the test_list to include only items in the allow_list +# Filter the test_list to include only items in the allow_list filtered_list=() for item in $test_list; do for allowed in "${allow_list[@]}"; do @@ -71,5 +90,5 @@ for item in $test_list; do done done -# # Print the filtered list in JSON format +# Print the filtered list in JSON format echo ${filtered_list[@]} | jq -Rc 'split(" ")' diff --git a/yarn-project/end-to-end/scripts/e2e_test_config.yml b/yarn-project/end-to-end/scripts/e2e_test_config.yml index 4ed71e04d03e..869813c0f3dd 100644 --- a/yarn-project/end-to-end/scripts/e2e_test_config.yml +++ b/yarn-project/end-to-end/scripts/e2e_test_config.yml @@ -82,6 +82,14 @@ tests: e2e_static_calls: {} e2e_synching: {} e2e_token_contract: {} + e2e_p2p_gossip: + test_path: 'e2e_p2p/gossip_network.test.ts' + e2e_p2p_upgrade_governance_proposer: + test_path: 'e2e_p2p/upgrade_governance_proposer.test.ts' + e2e_p2p_rediscovery: + test_path: 'e2e_p2p/rediscovery.test.ts' + e2e_p2p_reqresp: + test_path: 'e2e_p2p/reqresp.test.ts' flakey_e2e_tests: test_path: './src/flakey' ignore_failures: true diff --git a/yarn-project/end-to-end/src/e2e_p2p/gossip_network.test.ts b/yarn-project/end-to-end/src/e2e_p2p/gossip_network.test.ts index b59a5a7ed8b6..2520cd225b49 100644 --- a/yarn-project/end-to-end/src/e2e_p2p/gossip_network.test.ts +++ b/yarn-project/end-to-end/src/e2e_p2p/gossip_network.test.ts @@ -32,8 +32,7 @@ describe('e2e_p2p_network', () => { } }); - // TODO(https://github.com/AztecProtocol/aztec-packages/issues/9164): Currently flakey - it.skip('should rollup txs from all peers', async () => { + it('should rollup txs from all peers', async () => { // create the bootstrap node for the network if (!t.bootstrapNodeEnr) { throw new Error('Bootstrap node ENR is not available'); diff --git a/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts b/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts index 84a2aa53b8f8..040c7f6cb150 100644 --- a/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts +++ b/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts @@ -143,14 +143,20 @@ export class P2PNetworkTest { async stopNodes(nodes: AztecNodeService[]) { this.logger.info('Stopping nodes'); + + if (!nodes || !nodes.length) { + this.logger.info('No nodes to stop'); + return; + } + for (const node of nodes) { await node.stop(); } - await this.bootstrapNode.stop(); this.logger.info('Nodes stopped'); } async teardown() { + await this.bootstrapNode.stop(); await this.snapshotManager.teardown(); } } diff --git a/yarn-project/end-to-end/src/e2e_p2p/rediscovery.test.ts b/yarn-project/end-to-end/src/e2e_p2p/rediscovery.test.ts index c9d78f5d1cad..51c222e238ad 100644 --- a/yarn-project/end-to-end/src/e2e_p2p/rediscovery.test.ts +++ b/yarn-project/end-to-end/src/e2e_p2p/rediscovery.test.ts @@ -32,7 +32,7 @@ describe('e2e_p2p_rediscovery', () => { } }); - it.skip('should re-discover stored peers without bootstrap node', async () => { + it('should re-discover stored peers without bootstrap node', async () => { const contexts: NodeContext[] = []; nodes = await createNodes( t.ctx.aztecNodeConfig, diff --git a/yarn-project/end-to-end/src/e2e_p2p/reqresp_tx.test.ts b/yarn-project/end-to-end/src/e2e_p2p/reqresp.test.ts similarity index 100% rename from yarn-project/end-to-end/src/e2e_p2p/reqresp_tx.test.ts rename to yarn-project/end-to-end/src/e2e_p2p/reqresp.test.ts diff --git a/yarn-project/end-to-end/src/e2e_p2p/upgrade_governance_proposer.test.ts b/yarn-project/end-to-end/src/e2e_p2p/upgrade_governance_proposer.test.ts index 1340958204a8..665bc08c3cf0 100644 --- a/yarn-project/end-to-end/src/e2e_p2p/upgrade_governance_proposer.test.ts +++ b/yarn-project/end-to-end/src/e2e_p2p/upgrade_governance_proposer.test.ts @@ -17,7 +17,9 @@ import { P2PNetworkTest } from './p2p_network.js'; // Don't set this to a higher value than 9 because each node will use a different L1 publisher account and anvil seeds const NUM_NODES = 4; -const BOOT_NODE_UDP_PORT = 40600; +// Note: these ports must be distinct from the other e2e tests, else the tests will +// interfere with each other. +const BOOT_NODE_UDP_PORT = 45000; const DATA_DIR = './data/gossip'; @@ -36,18 +38,13 @@ describe('e2e_p2p_governance_proposer', () => { }); afterEach(async () => { - await t.stopNodes(nodes); await t.teardown(); + await t.stopNodes(nodes); for (let i = 0; i < NUM_NODES; i++) { fs.rmSync(`${DATA_DIR}-${i}`, { recursive: true, force: true }); } }); - /** - * There is some flaky behavior in here, likely similar to what is in the gossip test. - * For this reason we are not running it as part of the CI. - * TODO(https://github.com/AztecProtocol/aztec-packages/issues/9164): Currently flakey - */ it('Should cast votes to upgrade governanceProposer', async () => { // create the bootstrap node for the network if (!t.bootstrapNodeEnr) { diff --git a/yarn-project/p2p/src/bootstrap/bootstrap.ts b/yarn-project/p2p/src/bootstrap/bootstrap.ts index b80ed067a4f3..d3840ba51299 100644 --- a/yarn-project/p2p/src/bootstrap/bootstrap.ts +++ b/yarn-project/p2p/src/bootstrap/bootstrap.ts @@ -77,7 +77,7 @@ export class BootstrapNode { public async stop() { // stop libp2p await this.node?.stop(); - this.logger.debug('libp2p has stopped'); + this.logger.debug('Discv5 has stopped'); } /**