mirror of
https://github.com/logos-messaging/logos-messaging-interop-tests.git
synced 2026-07-08 09:30:14 +00:00
147 lines
5.0 KiB
YAML
147 lines
5.0 KiB
YAML
|
|
name: Interop Tests PR
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
node1:
|
|
required: true
|
|
type: string
|
|
description: "Node that usually publishes messages. Used for all tests"
|
|
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
|
|
|
|
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
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 120
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
repository: logos-messaging/logos-messaging-interop-tests
|
|
ref: SMOKE_TEST_STABLE
|
|
submodules: recursive
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
|
|
python-version: '3.12'
|
|
cache: 'pip'
|
|
|
|
- run: pip install -r requirements.txt
|
|
|
|
- name: Download nightly liblogosdelivery.so
|
|
id: download_lib
|
|
continue-on-error: true
|
|
uses: dawidd6/action-download-artifact@v6
|
|
with:
|
|
# Reuse the portable .so built each night by test_common.yml against the
|
|
# latest logos-delivery commit, instead of rebuilding it here.
|
|
workflow: nim_waku_daily.yml
|
|
workflow_conclusion: success
|
|
name: liblogosdelivery
|
|
path: vendor/logos-delivery-python-bindings/lib/
|
|
if_no_artifact_found: warn
|
|
|
|
- name: Build liblogosdelivery.so (fallback)
|
|
if: steps.download_lib.outputs.found_artifact != 'true'
|
|
run: |
|
|
set -euo pipefail
|
|
# No nightly artifact available (nightly failed / never ran). Build a
|
|
# portable .so from source so smoke tests stay self-sufficient.
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
util-linux iproute2 sudo ca-certificates curl make gcc g++
|
|
|
|
curl https://nim-lang.org/choosenim/init.sh -sSf | sh -s -- -y
|
|
export PATH="$HOME/.nimble/bin:$PATH"
|
|
choosenim 2.2.4
|
|
# Pin the nimble that generated nimble.lock; newer ones fail the checksum.
|
|
(cd /tmp && nimble install "nimble@0.22.3" -y)
|
|
|
|
BINDINGS_DIR="$(pwd)/vendor/logos-delivery-python-bindings"
|
|
DELIVERY_DIR="$BINDINGS_DIR/vendor/logos-delivery"
|
|
mkdir -p "$BINDINGS_DIR/lib"
|
|
|
|
cd "$DELIVERY_DIR"
|
|
# Match the nightly: build against the latest logos-delivery HEAD.
|
|
git fetch origin
|
|
DEFAULT_REF=$(git remote show origin | awk '/HEAD branch/ {print $NF}')
|
|
git checkout "origin/$DEFAULT_REF"
|
|
git submodule sync --recursive
|
|
git submodule update --init --recursive
|
|
|
|
ln -sf waku.nimble waku.nims
|
|
NIM_PARAMS="-d:disableMarchNative -d:marchOptimized" 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"
|
|
|
|
- name: Verify wrapper library
|
|
run: test -f vendor/logos-delivery-python-bindings/lib/liblogosdelivery.so
|
|
|
|
- name: Run tests
|
|
timeout-minutes: 30
|
|
env:
|
|
PYTHONPATH: ${{ github.workspace }}/vendor/logos-delivery-python-bindings/waku
|
|
run: |
|
|
pytest -m 'smoke' -n 4 --dist=loadgroup --reruns 1 --junit-xml=pytest_results.xml
|
|
|
|
- name: Test Report
|
|
if: always()
|
|
uses: dorny/test-reporter@95058abb17504553158e70e2c058fe1fda4392c2
|
|
with:
|
|
name: Pytest JUnit Test Report
|
|
path: pytest_results.xml
|
|
reporter: java-junit
|
|
use-actions-summary: 'true'
|
|
|
|
- name: Create job summary
|
|
if: always()
|
|
env:
|
|
JOB_STATUS: ${{ job.status }}
|
|
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
|
|
if [ "$JOB_STATUS" != "success" ]; then
|
|
echo "There are failures with nwaku node. cc <@&1111608257824440330>" >> $GITHUB_STEP_SUMMARY
|
|
fi
|
|
{
|
|
echo 'JOB_SUMMARY<<EOF'
|
|
cat $GITHUB_STEP_SUMMARY
|
|
echo EOF
|
|
} >> $GITHUB_ENV
|
|
|
|
|