-
Notifications
You must be signed in to change notification settings - Fork 2
Unit testing CI #36
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
Unit testing CI #36
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5a85c6a
added basic unittest ci
wangpatrick57 fe48706
now downloading python
wangpatrick57 1499665
fixed tab
wangpatrick57 9bfbc8d
now exiting with code 1 if unit tests fail
wangpatrick57 4444bfe
now installing dependencies
wangpatrick57 4ead1a1
made rust installation non-interactive and added . '/home/phw2/.cargo…
wangpatrick57 ffba4f8
added longer comment about dependencies in the GHA
wangpatrick57 92b265f
fixed test_workload by making paths absolute
wangpatrick57 ea865d1
fixed test_index_space:
wangpatrick57 340c84f
fixed test_primitive. it had a benign bug because I started counting …
wangpatrick57 7f1c79a
merge
wangpatrick57 8173db0
renamed dependency -> dependencies in code
wangpatrick57 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 was deleted.
Oops, something went wrong.
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,35 @@ | ||
name: Unit Tests | ||
|
||
on: | ||
push: {} | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: self-hosted | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
# We could choose to set up dependencies manually in the GHA runner instead of installing them during the GHA. | ||
# | ||
# However, I think it's better to do them in the GHA itself so that we're testing our dependency installation step | ||
# in addition to our actual code. It also removes the need to manually reinstall dependencies on the GHA runners | ||
# every time we add a new dependency. | ||
# | ||
# Note that the GHA runners are stateful. Dependencies installed from previous runs will still be on the runner. | ||
# This means this step will usually be pretty fast as most dependencies will already be cached. However, it also | ||
# means that past runs might interfere with the current run, so you sometimes may need to restart the GHA runners. | ||
- name: Install dependencies | ||
run: | | ||
./dependency/install_dependencies.sh | ||
. "$HOME/.cargo/env" | ||
|
||
- name: Run unit tests | ||
run: python scripts/run_unittests.py |
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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import unittest | ||
import sys | ||
|
||
if __name__ == "__main__": | ||
loader = unittest.TestLoader() | ||
suite = loader.discover(".") | ||
print(f"suite={suite}") | ||
runner = unittest.TextTestRunner() | ||
runner.run(suite) | ||
result = runner.run(suite) | ||
if not result.wasSuccessful(): | ||
# This is needed so that the GHA fails if the unit tests fail. | ||
sys.exit(1) |
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.