Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 25 additions & 6 deletions scripts/ci/get_e2e_jobs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(" ")'
8 changes: 8 additions & 0 deletions yarn-project/end-to-end/scripts/e2e_test_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions yarn-project/end-to-end/src/e2e_p2p/gossip_network.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
8 changes: 7 additions & 1 deletion yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/e2e_p2p/rediscovery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/p2p/src/bootstrap/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand Down