-
Couldn't load subscription status.
- Fork 4
Provide CI testing support #8
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c0ec9a7
Update workflows to use setup-python v5
mitchnegus c1c1326
Update workflow comment headers
mitchnegus cae46ac
Remove hardcoded path in CLI completion test
mitchnegus c05e846
Fix bug where helper arguments ignore quoted values (via shlex)
mitchnegus b65ba77
Remove unnecessary tox environment variables (passed automatically)
mitchnegus abafe77
Update built-in unit test helper to show coverage and transfer pytest…
mitchnegus 9e68597
Use pytest builtin marker exclusion
mitchnegus e0a789a
Add a marker to indicate MC-dependent tests
mitchnegus 38050c5
Add an optional dependency group for default MC repos
mitchnegus 445e389
Extend pytest configuration hooks to helper-run tests
mitchnegus 7b5eb66
Use a composite action to prepare tox
mitchnegus 980a917
Use a composite action to prepare minimega
mitchnegus bef5108
Use a composite action to prepare discovery
mitchnegus b02887d
Use a composite action to prepare FIREWHEEL
mitchnegus 8026612
Add unit tests to GitHub workflows
mitchnegus 5681fce
Drop coverage requirement to 60% so that tests pass
mitchnegus 497d10e
Remove development dependencies from testing CI
mitchnegus 222a05e
Reinclude tox in dev requirements
mitchnegus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # A composite action to install discovery | ||
|
|
||
| name: Prepare discovery | ||
|
|
||
| description: Install discovery | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Install discovery | ||
| run: | | ||
| wget https://github.com/mitchnegus/minimega-discovery/releases/download/firewheel-debian_faed761/discovery.deb | ||
| sudo dpkg -i discovery.deb | ||
| sudo chown -R $USER:minimega /opt/discovery | ||
| shell: bash | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # A composite action to install, configure, and initialize FIREWHEEL. | ||
| # This action assumes that minimega and discovery have already been installed. | ||
|
|
||
| name: Prepare FIREWHEEL | ||
|
|
||
| description: Install, configure, and initialize FIREWHEEL | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Install FIREWHEEL | ||
| run: | | ||
| pip install --upgrade pip | ||
| pip install . | ||
| sudo ln -s $(which firewheel) /usr/local/bin/firewheel | ||
| ssh-keygen -t rsa -f "$HOME/.ssh/id_rsa" -N "" | ||
| ssh-keyscan -t rsa $(hostname) >> $HOME/.ssh/known_hosts | ||
| cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys | ||
| shell: bash | ||
| - name: Configure FIREWHEEL | ||
| run: | | ||
| firewheel config set -s cluster.compute $(hostname) | ||
| firewheel config set -s cluster.control $(hostname) | ||
| firewheel config set -s grpc.hostname $GRPC_HOSTNAME | ||
| firewheel config set -s minimega.experiment_interface $EXPERIMENT_INTERFACE | ||
| firewheel config set -s logging.root_dir $LOG_DIR | ||
| shell: bash | ||
| - name: Initialize FIREWHEEL | ||
| run: | | ||
| firewheel init | ||
| firewheel sync # will produce `chgrp` errors (but permissions are sufficient) | ||
| firewheel start | ||
| shell: bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # A composite action to install and initialize minimega | ||
|
|
||
| name: Prepare minimega | ||
|
|
||
| description: Install and initialize minimega | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Install minimega | ||
| run: | | ||
| wget https://github.com/sandia-minimega/minimega/releases/download/2.9/minimega-2.9.deb | ||
| sudo dpkg -i minimega-2.9.deb | ||
| sudo chown -R $USER:minimega $MM_INSTALL_DIR | ||
| sudo ln -s $MM_INSTALL_DIR/bin/minimega /usr/local/bin/minimega | ||
| sudo ln -s $MM_INSTALL_DIR/bin/minimega /usr/local/bin/mm | ||
sdelliot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| shell: bash | ||
| - name: Initialize minimega | ||
| run: | | ||
| echo -n "" | sudo $MM_INSTALL_DIR/misc/daemon/minimega.init install | ||
| sudo mkdir -p $(dirname $MINIMEGA_CONFIG) | ||
| sudo sed -i "s|MINIMEGA_DIR=\"/opt/minimega/\"|MINIMEGA_DIR=\"$MM_INSTALL_DIR/\"|g" $MINIMEGA_CONFIG | ||
| sudo sed -i "s|MM_RUN_PATH=\"/tmp/minimega\"|MM_RUN_PATH=\"$MM_BASE/\"|g" $MINIMEGA_CONFIG | ||
| sudo sed -i "s|MM_MESH_DEGREE=0|MM_MESH_DEGREE=1|g" $MINIMEGA_CONFIG | ||
| sudo sed -i "s|MM_LOG_LEVEL=\"error\"|MM_LOG_LEVEL=\"debug\"|g" $MINIMEGA_CONFIG | ||
| sudo sed -i "s|MM_LOG_FILE=\"/tmp/minimega.log\"|MM_LOG_FILE=\"$LOG_DIR/minimega.log\"|g" $MINIMEGA_CONFIG | ||
| sudo systemctl restart minimega | ||
| sudo chown -R $USER:minimega $MM_BASE $LOG_DIR | ||
| shell: bash | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # A composite action to prepare tox-based workflows | ||
|
|
||
| name: Prepare tox | ||
|
|
||
| description: Prepare tox-based workflows | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
sdelliot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: Ensure upgraded pip | ||
| run: pip install --upgrade pip | ||
| shell: bash | ||
| - name: Install tox | ||
| run: pip install tox | ||
| shell: bash | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # This workflow will install Python dependencies and run tests with a variety of Python versions | ||
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
|
||
| name: Testing | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "*" ] | ||
| pull_request: | ||
| branches: [ "main" ] | ||
|
|
||
| env: | ||
| LOG_DIR: /var/log/firewheel | ||
| MINIMEGA_CONFIG: /etc/minimega/minimega.conf | ||
| # Set the FIREWHEEL environment variables | ||
| EXPERIMENT_INTERFACE: lo | ||
| MM_BASE: /tmp/minimega | ||
| MM_INSTALL_DIR: /opt/minimega | ||
| GRPC_HOSTNAME: localhost | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
sdelliot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| matrix: | ||
| python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y tar net-tools procps uml-utilities \ | ||
| openvswitch-switch qemu-kvm qemu-utils dnsmasq \ | ||
| ntfs-3g iproute2 libpcap-dev | ||
| - name: Prepare minimega | ||
| uses: ./.github/actions/prepare-minimega | ||
| - name: Prepare discovery | ||
| uses: ./.github/actions/prepare-discovery | ||
| - name: Prepare FIREWHEEL | ||
| uses: ./.github/actions/prepare-firewheel | ||
| - name: Run unit tests | ||
| run: | | ||
| firewheel test unit -m 'not long and not mcs' \ | ||
| --cov --cov-report=term --cov-fail-under=60 | ||
sdelliot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.