mirror of
https://github.com/logos-messaging/logos-messaging-interop-tests.git
synced 2026-05-18 08:19:32 +00:00
* add test s17 * Add temp changes * Add s17 positive / negative scenarios * add S19 * Add S06 relay-only test and fix wrapper helpers (#173) * - Add S06 relay-only test case for testing message propagation without a store. - Update `wrapper_helpers` for clearer event type handling and type annotations (`Optional[...]` usage). - Simplify `get_node_multiaddr` to retrieve addresses via `get_node_info_raw`. - Refactor `wrappers_manager` to adjust bindings path to `vendor` directory and add `get_node_info_raw` method. - Update `.gitignore` to exclude `store.sqlite3*`. * Refactor S06 relay-only test: replace try-finally blocks with context managers for clarity and conciseness. * Migrate S06 relay-only test to `test_send_e2e.py` and refactor with `StepsCommon` for reusability. --------- Co-authored-by: Egor Rachkovskii <egorrachkovskii@status.im> * Modify S19 test * Adding S21 * Fix review comments * Adding S22/S23 * Adding S24 * Add S26 * Add S30 * Add S31 * Improve `wait_for_event` loop logic and add `assert_event_invariants` helper (#178) - Refactored the `wait_for_event` function for clarity and to ensure proper deadline handling within the loop. - Introduced `assert_event_invariants` to validate per-request event properties, enforcing invariants like correct `requestId`, no duplicate terminal events, and proper timing between `Propagated` and `Sent`. - Added tests for `assert_event_invariants` enforcement in `S14` and `S15` lightpush scenarios. Co-authored-by: Egor Rachkovskii <egorrachkovskii@status.im> * Add S07 and S10 send API tests with event invariants helper (#176) * Add `assert_event_invariants` to enforce per-request event constraints and integrate into relevant tests * Integrate `assert_event_invariants` into edge and store tests * Remove redundant comments from `test_send_e2e.py` --------- Co-authored-by: Egor Rachkovskii <egorrachkovskii@status.im> * Fix some tests * Add S02/S12 send API tests and PR CI pipeline (#174) * Add tests for auto-subscribe on first send and isolated sender with no peers * Add PR CI workflow with tiered test strategy - pr_tests.yml: build job with cache, wrapper-tests, smoke-tests, and label-triggered full-suite - test_common.yml: add deploy_allure/send_discord inputs so PR runs skip reporting side effects - Add docker_required marker to S19 (needs Docker, excluded from wrapper-only CI job) - Register docker_required marker in pytest.ini * Document PR CI test workflows in README * Refine PR CI test strategy: - Exclude `docker_required` tests from smoke set in `pr_tests.yml`. - Add `wait_for_connected` helper for connection state checks. - Update S19 test to dynamically create and clean up the store node setup. - General simplifications and improved test stability. * Add `wait_for_connected` assertion to ensure sender connection state before propagation test * Refine tests and CI workflows: - Replace `ERROR_TIMEOUT_S` with `ERROR_AFTER_CACHE_EXPIRY_TIMEOUT_S` in `test_send_e2e.py`. - Adjust timeout assertion for better clarity and accuracy. - Update `pr_tests.yml` to add retries (`--reruns`) and ignore wrapper tests in smoke tests. - Change `test_common.yml` default Discord reporting to `false`. * Normalize `portsshift` to `portsShift` in `test_send_e2e.py` configuration definitions. --------- Co-authored-by: Egor Rachkovskii <egorrachkovskii@status.im> * Add relay-to-lightpush fallback integration tests (S08/S09) (#180) Co-authored-by: Egor Rachkovskii <egorrachkovskii@status.im> * Ignore S19 * fix s26 * Ignore s20 / s31 for errors * Change image name * fix xfail syntax error * rename test file * FIx flaky tests * comment the skipped tests * Fix review comments * revert tag in yml in latest * commenting lightpush * Modify the PR * Fix the ports conflict * Modify S20 * fix portsshift option * remove the /true from yml to allow errors to exist * Modify the yml to continue on error * First set of review comments * adding xfail mark for failed tests * address review comments about xfail * cleanup unused lines * event collector fix * Address review comment about delay constant * fix the timeout review comment * Add assert_event_invariants * enhance comment on S26 test * mark the waku tests as docker_required * Mark `test_s10_edge_lightpush_propagation` as xfail due to broken lightpush peer discovery. * Mark `test_s15_lightpush_retryable_error_then_recovery` as xfail due to broken lightpush peer discovery. --------- Co-authored-by: Egor Rachkovskii <32649334+at0m1x19@users.noreply.github.com> Co-authored-by: Egor Rachkovskii <egorrachkovskii@status.im>
384 lines
13 KiB
YAML
384 lines
13 KiB
YAML
name: Interop Tests Common
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
node1:
|
|
required: true
|
|
description: "Node that usually publishes messages. Used for all tests"
|
|
type: string
|
|
default: "wakuorg/nwaku:latest"
|
|
node2:
|
|
required: true
|
|
description: "Node that usually queries for published messages. Used for all tests"
|
|
type: string
|
|
default: "wakuorg/nwaku:latest"
|
|
additional_nodes:
|
|
required: false
|
|
description: "Additional optional nodes used in e2e tests, separated by ,"
|
|
type: string
|
|
default: "wakuorg/nwaku:latest,wakuorg/nwaku:latest,wakuorg/nwaku:latest"
|
|
caller:
|
|
required: false
|
|
description: "Workflow caller. Used in reporting"
|
|
type: string
|
|
fleet_tests:
|
|
required: false
|
|
description: "Run fleet tests only"
|
|
type: boolean
|
|
default: false
|
|
deploy_allure:
|
|
required: false
|
|
description: "Deploy allure report to gh-pages"
|
|
type: boolean
|
|
default: true
|
|
send_discord:
|
|
required: false
|
|
description: "Send test results to Discord"
|
|
type: boolean
|
|
default: false
|
|
|
|
env:
|
|
FORCE_COLOR: "1"
|
|
NODE_1: ${{ inputs.node1 }}
|
|
NODE_2: ${{ inputs.node2 }}
|
|
ADDITIONAL_NODES: ${{ inputs.additional_nodes }}
|
|
CALLER: ${{ inputs.caller || 'manual' }}
|
|
RLN_CREDENTIALS: ${{ secrets.RLN_CREDENTIALS }}
|
|
|
|
jobs:
|
|
tests:
|
|
name: tests
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
shard: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]
|
|
# total number of shards =18 means tests will split into 18 thread and run in parallel to increase execution speed
|
|
# command for sharding :
|
|
# pytest --shard-id=<shard_number> --num-shards=<total_shards>
|
|
# shard 16 for test_rln.py file as they shall run sequentially
|
|
# shard 17 for test_cursor_many_msgs.py as it takes time >7 mins
|
|
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 120
|
|
outputs:
|
|
jobResult_0: ${{ steps.set_result.outputs.JOB_RESULT_0 }}
|
|
jobResult_1: ${{ steps.set_result.outputs.JOB_RESULT_1 }}
|
|
jobResult_2: ${{ steps.set_result.outputs.JOB_RESULT_2 }}
|
|
jobResult_3: ${{ steps.set_result.outputs.JOB_RESULT_3 }}
|
|
jobResult_4: ${{ steps.set_result.outputs.JOB_RESULT_4 }}
|
|
jobResult_5: ${{ steps.set_result.outputs.JOB_RESULT_5 }}
|
|
jobResult_6: ${{ steps.set_result.outputs.JOB_RESULT_6 }}
|
|
jobResult_7: ${{ steps.set_result.outputs.JOB_RESULT_7 }}
|
|
jobResult_8: ${{ steps.set_result.outputs.JOB_RESULT_8 }}
|
|
jobResult_9: ${{ steps.set_result.outputs.JOB_RESULT_9 }}
|
|
jobResult_10: ${{ steps.set_result.outputs.JOB_RESULT_10 }}
|
|
jobResult_11: ${{ steps.set_result.outputs.JOB_RESULT_11 }}
|
|
jobResult_12: ${{ steps.set_result.outputs.JOB_RESULT_12 }}
|
|
jobResult_13: ${{ steps.set_result.outputs.JOB_RESULT_13 }}
|
|
jobResult_14: ${{ steps.set_result.outputs.JOB_RESULT_14 }}
|
|
jobResult_15: ${{ steps.set_result.outputs.JOB_RESULT_15 }}
|
|
jobResult_16: ${{ steps.set_result.outputs.JOB_RESULT_16 }}
|
|
jobResult_17: ${{ steps.set_result.outputs.JOB_RESULT_17 }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Remove unwanted software
|
|
uses: ./.github/actions/prune-vm
|
|
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.12"
|
|
cache: "pip"
|
|
|
|
- name: Add python bindings to PYTHONPATH
|
|
run: echo "PYTHONPATH=$(pwd)/vendor/logos-delivery-python-bindings/waku:$PYTHONPATH" >> $GITHUB_ENV
|
|
|
|
- name: Install system deps for tc / nsenter
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
util-linux \
|
|
iproute2 \
|
|
sudo \
|
|
ca-certificates \
|
|
curl \
|
|
make \
|
|
gcc \
|
|
g++
|
|
|
|
- name: Install Nim 2.2.4
|
|
run: |
|
|
set -euo pipefail
|
|
curl https://nim-lang.org/choosenim/init.sh -sSf | sh -s -- -y
|
|
echo "$HOME/.nimble/bin" >> "$GITHUB_PATH"
|
|
export PATH="$HOME/.nimble/bin:$PATH"
|
|
choosenim 2.2.4
|
|
nim --version
|
|
nimble --version
|
|
|
|
- run: pip install -r requirements.txt
|
|
|
|
- name: Build liblogosdelivery.so for python bindings
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
export PATH="$HOME/.nimble/bin:$PATH"
|
|
|
|
BINDINGS_DIR="$(pwd)/vendor/logos-delivery-python-bindings"
|
|
DELIVERY_DIR="$BINDINGS_DIR/vendor/logos-delivery"
|
|
|
|
mkdir -p "$BINDINGS_DIR/lib"
|
|
|
|
cd "$DELIVERY_DIR"
|
|
|
|
ln -sf waku.nimble waku.nims
|
|
|
|
# install Nim deps
|
|
nimble install -y
|
|
|
|
# do the real setup, do not fake .nimble-setup
|
|
make setup
|
|
|
|
# now build the shared library
|
|
make liblogosdelivery
|
|
|
|
SO_PATH="$(find . -type f -name 'liblogosdelivery.so' | head -n 1)"
|
|
|
|
if [ -z "$SO_PATH" ]; then
|
|
echo "liblogosdelivery.so was not built"
|
|
exit 1
|
|
fi
|
|
|
|
cp "$SO_PATH" "$BINDINGS_DIR/lib/liblogosdelivery.so"
|
|
|
|
echo "Built library:"
|
|
ls -l "$BINDINGS_DIR/lib/liblogosdelivery.so"
|
|
|
|
# Cleanup build artifacts
|
|
rm -rf .gh-pages/nim
|
|
|
|
|
|
- name: Verify wrapper library
|
|
run: |
|
|
test -f vendor/logos-delivery-python-bindings/lib/liblogosdelivery.so
|
|
|
|
- name: Debug Python import paths
|
|
run: |
|
|
pwd
|
|
echo "PYTHONPATH=$PYTHONPATH"
|
|
find . -maxdepth 5 | grep wrapper || true
|
|
python - <<'PY'
|
|
import sys
|
|
print("sys.path:")
|
|
for p in sys.path:
|
|
print(p)
|
|
try:
|
|
import wrapper
|
|
print("wrapper import OK:", wrapper)
|
|
except Exception as e:
|
|
print("wrapper import failed:", e)
|
|
raise
|
|
PY
|
|
|
|
- name: Run tests
|
|
run: |
|
|
export PATH="$HOME/.nimble/bin:$PATH"
|
|
export PYTHONPATH="$(pwd)/vendor/logos-delivery-python-bindings/waku:$PYTHONPATH"
|
|
|
|
if [ "${{ inputs.fleet_tests }}" == "true" ]; then
|
|
if [ "${{ matrix.shard }}" == "0" ]; then
|
|
pytest --fleet -m waku_test_fleet \
|
|
--ignore=vendor/logos-delivery-python-bindings/tests \
|
|
--alluredir=allure-results-${{ matrix.shard }}
|
|
else
|
|
echo "Skipping shard ${{ matrix.shard }}: fleet tests run on shard 0 only"
|
|
fi
|
|
elif [ "${{ matrix.shard }}" == "16" ]; then
|
|
pytest tests/relay/test_rln.py \
|
|
--ignore=vendor/logos-delivery-python-bindings/tests \
|
|
--alluredir=allure-results-${{ matrix.shard }}
|
|
elif [ "${{ matrix.shard }}" == "17" ]; then
|
|
pytest tests/store/test_cursor_many_msgs.py \
|
|
--ignore=vendor/logos-delivery-python-bindings/tests \
|
|
--alluredir=allure-results-${{ matrix.shard }}
|
|
else
|
|
pytest \
|
|
--ignore=vendor/logos-delivery-python-bindings/tests \
|
|
--ignore=tests/relay/test_rln.py \
|
|
--ignore=tests/store/test_cursor_many_msgs.py \
|
|
--reruns 2 \
|
|
--shard-id=${{ matrix.shard }} \
|
|
--num-shards=16 \
|
|
--alluredir=allure-results-${{ matrix.shard }}
|
|
fi
|
|
|
|
- name: Upload allure results
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: allure-results-${{ matrix.shard }}
|
|
path: allure-results-${{ matrix.shard }}
|
|
|
|
- name: Set job result
|
|
id: set_result
|
|
if: always()
|
|
run: |
|
|
version="${{ matrix.shard }}"
|
|
echo "JOB_RESULT_${version}=${{ job.status }}" >> "$GITHUB_OUTPUT"
|
|
|
|
aggregate-reports:
|
|
runs-on: ubuntu-latest
|
|
needs: [tests]
|
|
if: always() && inputs.deploy_allure
|
|
|
|
steps:
|
|
- name: Download all allure results
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: all-results
|
|
merge-multiple: true
|
|
|
|
- name: Check out gh-pages history if it exists
|
|
id: checkout_gh_pages
|
|
continue-on-error: true
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: gh-pages
|
|
path: gh-pages
|
|
fetch-depth: 1
|
|
|
|
- name: Prepare empty gh-pages fallback
|
|
if: steps.checkout_gh_pages.outcome != 'success'
|
|
run: |
|
|
mkdir -p gh-pages/${{ env.CALLER }}/last-history
|
|
|
|
- name: Remove oversized Allure text attachments
|
|
if: always()
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
echo "Before cleanup:"
|
|
find all-results -type f | wc -l || true
|
|
du -sh all-results || true
|
|
|
|
find all-results -type f -name "*.txt" -delete || true
|
|
|
|
echo "After cleanup:"
|
|
find all-results -type f | wc -l || true
|
|
du -sh all-results || true
|
|
|
|
- name: Setup allure report
|
|
uses: simple-elf/allure-report-action@master
|
|
if: always()
|
|
id: allure-report
|
|
with:
|
|
allure_results: all-results
|
|
gh_pages: gh-pages/${{ env.CALLER }}
|
|
allure_history: allure-history
|
|
keep_reports: 10
|
|
report_url: https://logos-messaging.github.io/logos-delivery-interop-tests/${{ env.CALLER }}
|
|
|
|
- name: Fix permissions (CRITICAL)
|
|
if: always()
|
|
run: |
|
|
echo "Fixing permissions..."
|
|
sudo chown -R $USER:$USER allure-history || true
|
|
sudo chmod -R u+rwX allure-history || true
|
|
|
|
- name: Clean allure-history
|
|
if: always()
|
|
run: |
|
|
echo "Cleaning allure-history..."
|
|
|
|
# Remove ALL txt attachments from history
|
|
find allure-history -type f -name "*.txt" -delete || true
|
|
|
|
echo "After cleanup:"
|
|
du -sh allure-history || true
|
|
|
|
- name: Verify generated report content
|
|
if: always()
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
test -d allure-history
|
|
test -d "allure-history/${{ github.run_number }}"
|
|
test -f "allure-history/${{ github.run_number }}/index.html"
|
|
test -d "allure-history/last-history"
|
|
|
|
echo "=== allure-history size ==="
|
|
du -sh allure-history || true
|
|
|
|
echo "=== largest files ==="
|
|
find allure-history -type f -printf '%s %p\n' | sort -nr | head -50 || true
|
|
|
|
echo "=== symlinks ==="
|
|
find allure-history -type l -ls || true
|
|
|
|
echo "=== hard-linked files ==="
|
|
find allure-history -type f -links +1 -ls || true
|
|
|
|
echo "=== top-level tree ==="
|
|
find allure-history -maxdepth 2 -type f | sort | head -100 || true
|
|
|
|
- name: Deploy report to Github Pages
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_branch: gh-pages
|
|
publish_dir: ./allure-history
|
|
destination_dir: ${{ env.CALLER }}
|
|
keep_files: false
|
|
enable_jekyll: false
|
|
|
|
- name: Store output from matrix jobs
|
|
run: |
|
|
echo '${{ toJSON(needs.tests.outputs) }}' > results.json
|
|
|
|
- name: Create job summary
|
|
if: always()
|
|
run: |
|
|
echo "## Run Information" >> $GITHUB_STEP_SUMMARY
|
|
echo "- **Event**: ${{ github.event_name }}" >> $GITHUB_STEP_SUMMARY
|
|
echo "- **Actor**: ${{ github.actor }}" >> $GITHUB_STEP_SUMMARY
|
|
echo "- **Node1**: ${{ env.NODE_1 }}" >> $GITHUB_STEP_SUMMARY
|
|
echo "- **Node2**: ${{ env.NODE_2 }}" >> $GITHUB_STEP_SUMMARY
|
|
echo "- **Additonal Nodes**: ${{ env.ADDITIONAL_NODES }}" >> $GITHUB_STEP_SUMMARY
|
|
echo "## Test Results" >> $GITHUB_STEP_SUMMARY
|
|
echo "Allure report will be available at: https://logos-messaging.github.io/logos-delivery-interop-tests/${{ env.CALLER }}/${{ github.run_number }}" >> $GITHUB_STEP_SUMMARY
|
|
|
|
TESTS_RESULT="success"
|
|
for key in $(jq -r 'keys[]' results.json); do
|
|
result=$(jq -r --arg key "$key" '.[$key]' results.json)
|
|
echo "Key: $key, Value: $result"
|
|
if [ -n "$result" ] && [ "$result" != "success" ]; then
|
|
echo "Value 'success' not found at key: $key"
|
|
TESTS_RESULT="failure"
|
|
break
|
|
fi
|
|
done
|
|
|
|
if [ "$TESTS_RESULT" != "success" ]; then
|
|
echo "There are failures with nwaku node. cc <@&1111608257824440330>" >> $GITHUB_STEP_SUMMARY
|
|
fi
|
|
|
|
echo "TESTS_RESULT=$TESTS_RESULT" >> $GITHUB_ENV
|
|
{
|
|
echo 'JOB_SUMMARY<<EOF'
|
|
cat $GITHUB_STEP_SUMMARY
|
|
echo EOF
|
|
} >> $GITHUB_ENV
|
|
|
|
- name: Send report to Discord
|
|
uses: rjstone/discord-webhook-notify@v1
|
|
if: always() && env.CALLER != 'manual' && inputs.send_discord
|
|
with:
|
|
severity: ${{ env.TESTS_RESULT == 'success' && 'info' || 'error' }}
|
|
username: ${{ github.workflow }}
|
|
description: "## Job Result: ${{ env.TESTS_RESULT }}"
|
|
details: ${{ env.JOB_SUMMARY }}
|
|
webhookUrl: ${{ secrets.DISCORD_TEST_REPORTS_WH }} |