Skip to content

Commit

Permalink
chore: nayduck in ci on merge (#12132)
Browse files Browse the repository at this point in the history
Adding nayduck to ci on merge. Adding only one group of tests for now.
Extracting small portion of tests taking >12m to complete to
very_expensive.txt, fixing them should be a rare event anyway.

---------

Co-authored-by: Andrei <[email protected]>
  • Loading branch information
Longarithm and andrei-near authored Sep 25, 2024
1 parent 6b76ee6 commit fe92b5a
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 31 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/nayduck_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI Nayduck tests
on:
merge_group:

workflow_dispatch:

jobs:
nayduck_tests:
runs-on: "ubuntu-latest"
environment: development
timeout-minutes: 60

steps:
- name: Install JQ json processor
run: sudo apt install jq

- name: Install required python modules
run: |
pip3 install -r pytest/requirements.txt
- name: Create nayduck-code file
run: |
echo ${{ secrets.NAYDUCK_CODE }} > ~/.config/nayduck-code
- name: Run Nayduck tests and wait for results
run: |
NEW_TEST=$(python3 scripts/nayduck.py --test-file nightly/ci.txt)
RUN_ID=$(echo $NEW_TEST | grep https | sed -E 's|.*\/run\/([0-9]+)|\1|g')
# wait all the tests to finish
while true; do
TEST_RESULTS=$(curl -s https://nayduck.nearone.org/api/run/$RUN_ID)
TESTS_NOT_READY=$( jq -e '.tests | .[] | select(.status == "RUNNING" or .status == "PENDING" ) ' <<< ${TEST_RESULTS} )
if [ -z "$TESTS_NOT_READY" ]; then break; fi
sleep 15
done
UNSUCCESSFUL_TESTS=$(jq -e '.tests | .[] | select(.status != "PASSED" and .status != "IGNORED") ' <<< ${TEST_RESULTS} )
if [ -z "$UNSUCCESSFUL_TESTS" ]; then
echo "Nayduck CI tests passed."
echo "Results available at https://nayduck.nearone.org/#/run/$RUN_ID"
else
echo "CI Nayduck tests are failing https://nayduck.nearone.org/#/run/$RUN_ID."
echo "Fix them before merging"
exit 1
fi
21 changes: 0 additions & 21 deletions .github/workflows/nightly_nayduck.yml

This file was deleted.

2 changes: 2 additions & 0 deletions nightly/ci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# TODO: add remaining tests.
./pytest.txt
6 changes: 0 additions & 6 deletions nightly/expensive.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ expensive --timeout=1800 near-client near_client tests::catching_up::test_catchu
expensive --timeout=1800 near-client near_client tests::catching_up::test_catchup_random_single_part_sync_height_6 --features nightly
expensive --timeout=1800 near-client near_client tests::catching_up::test_catchup_sanity_blocks_produced
expensive --timeout=1800 near-client near_client tests::catching_up::test_catchup_sanity_blocks_produced --features nightly
expensive --timeout=3600 near-client near_client tests::catching_up::test_all_chunks_accepted_1000
expensive --timeout=3600 near-client near_client tests::catching_up::test_all_chunks_accepted_1000 --features nightly
expensive --timeout=7200 near-client near_client tests::catching_up::test_all_chunks_accepted_1000_slow
expensive --timeout=7200 near-client near_client tests::catching_up::test_all_chunks_accepted_1000_slow --features nightly
expensive --timeout=1800 near-client near_client tests::catching_up::test_all_chunks_accepted_1000_rare_epoch_changing
expensive --timeout=1800 near-client near_client tests::catching_up::test_all_chunks_accepted_1000_rare_epoch_changing --features nightly
expensive --timeout=1800 near-client near_client tests::catching_up::test_catchup_receipts_sync_hold
expensive --timeout=1800 near-client near_client tests::catching_up::test_catchup_receipts_sync_hold --features nightly

Expand Down
1 change: 1 addition & 0 deletions nightly/nightly.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
./sandbox.txt
./pytest.txt
./expensive.txt
./very_expensive.txt
3 changes: 0 additions & 3 deletions nightly/pytest-sanity.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,6 @@ pytest --timeout=300 sanity/rpc_hash.py --features nightly
pytest sanity/rosetta.py
pytest sanity/rosetta.py --features nightly

# Make sure Docker image can be build and run
pytest --skip-build --timeout=1h sanity/docker.py

# This is the test for meta transactions.
pytest sanity/meta_tx.py --features nightly

Expand Down
11 changes: 11 additions & 0 deletions nightly/very_expensive.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Catchup tests
expensive --timeout=3600 near-client near_client tests::catching_up::test_all_chunks_accepted_1000
expensive --timeout=3600 near-client near_client tests::catching_up::test_all_chunks_accepted_1000 --features nightly
expensive --timeout=7200 near-client near_client tests::catching_up::test_all_chunks_accepted_1000_slow
expensive --timeout=7200 near-client near_client tests::catching_up::test_all_chunks_accepted_1000_slow --features nightly
expensive --timeout=1800 near-client near_client tests::catching_up::test_all_chunks_accepted_1000_rare_epoch_changing
expensive --timeout=1800 near-client near_client tests::catching_up::test_all_chunks_accepted_1000_rare_epoch_changing --features nightly

# Make sure Docker image can be build and run
pytest --skip-build --timeout=1h sanity/docker.py

2 changes: 1 addition & 1 deletion scripts/nayduck.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def impl(lines: typing.Iterable[str],
line = line.rstrip()
if line.startswith('./') or (include_comments and
line.startswith('#./')):
if depth == 3:
if depth == 4:
print(f'{filename}:{lineno}: ignoring {line}; '
f'would exceed depth limit of {depth}')
else:
Expand Down

0 comments on commit fe92b5a

Please sign in to comment.