Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ci netsim integration tests #877

Merged
merged 2 commits into from
Mar 23, 2023
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
69 changes: 69 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,3 +277,72 @@ jobs:
arguments: --workspace --all-features
command: check
command-arguments: "-Dwarnings"

netsim-integration-tests:
name: Run network simulations/benchmarks
runs-on: [self-hosted, linux, X64]
steps:
- name: Checkout
uses: actions/checkout@master
with:
submodules: recursive

- name: Install rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Build iroh
run: |
cargo build --release

- name: Fetch and build chuck
run: |
git clone https://github.com/n0-computer/chuck.git
cd chuck
cargo build --release

- name: Install netsim deps
run: |
cd chuck/netsim
sudo apt update
./setup.sh

- name: Copy binaries to right location
run: |
cp target/release/iroh chuck/netsim/bins/iroh
cp chuck/target/release/chuck chuck/netsim/bins/chuck

- name: Run tests
run: |
cd chuck/netsim
sudo kill -9 $(pgrep ovs)
sudo mn --clean
sudo python3 main.py --integration sims/standard/iroh.json

- name: Setup Environment (PR)
if: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
echo "LAST_COMMIT_SHA=$(git rev-parse --short ${{ github.event.pull_request.head.sha }})" >> ${GITHUB_ENV}
echo "HEAD_REF=${{ github.event.pull_request.head.ref }}" >> ${GITHUB_ENV}
- name: Setup Environment (Push)
if: ${{ github.event_name == 'push' }}
shell: bash
run: |
echo "LAST_COMMIT_SHA=$(git rev-parse --short ${GITHUB_SHA})" >> ${GITHUB_ENV}
echo "HEAD_REF=${{ github.head_ref }}" >> ${GITHUB_ENV}

- name: Generate reports
run: |
cd chuck/netsim
python3 reports_csv.py --prom --commit ${{ env.LAST_COMMIT_SHA }} > report_prom.txt
python3 reports_csv.py --metro --commit ${{ env.LAST_COMMIT_SHA }} > report_metro.txt

- name: Echo metrics
run: |
cd chuck/netsim
d=$(cat report_metro.txt)
metro_data=$(printf "%s\n " "$d")
echo "$metro_data"
2 changes: 1 addition & 1 deletion .github/workflows/netsim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- name: Build iroh
run: |
cargo build --release
cargo build --profile optimized-release

- name: Fetch and build chuck
run: |
Expand Down