-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**Summary**: Made GitHub Action which installs dependencies and runs all unit tests in the repository. **Demo**: A successful run. You can view it [here](https://github.com/cmu-db/dbgym/actions/runs/9831741840/job/27139551785). ![Screenshot 2024-07-07 at 17 56 58](https://github.com/cmu-db/dbgym/assets/20631215/c2613191-49eb-4d86-b0c2-a59a66e899c5) **Details**: * Also fixed some benign errors in the unit tests. Some paths were previously relative and had to be changed to be absolute. I also started counting index names from 0 instead of 1, which led to another test failure.
- Loading branch information
1 parent
3245aab
commit e373554
Showing
9 changed files
with
52 additions
and
33 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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: | | ||
./dependencies/install_dependencies.sh | ||
. "$HOME/.cargo/env" | ||
- name: Run unit tests | ||
run: python scripts/run_unittests.py |
This file contains 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,5 +1,5 @@ | ||
#!/bin/bash | ||
# You may want to create a conda environment before doing this | ||
pip install -r dependency/requirements.txt | ||
cat dependency/apt_requirements.txt | xargs sudo apt-get install -y | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh | ||
pip install -r dependencies/requirements.txt | ||
cat dependencies/apt_requirements.txt | xargs sudo apt-get install -y | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y |
This file was deleted.
Oops, something went wrong.
This file contains 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 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 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 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 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