Skip to content

Commit

Permalink
Utilize Automatic Package Discovery
Browse files Browse the repository at this point in the history
Co-authored-by: mason.davis <[email protected]>
  • Loading branch information
DS-KoolAid and mas0nd authored Jan 27, 2023
1 parent 0545e59 commit ecf3313
Show file tree
Hide file tree
Showing 28 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
python-version: 3.11
- run: pip install requests
- name: Dispatch Runner Event
run: python integration/runner_helper.py dispatch
run: python test/runner_helper.py dispatch
Integration-Testing:
name: Gato Integration Testing
needs: SH-Runner-Dispatch
Expand All @@ -61,4 +61,4 @@ jobs:
pip install ".[test]"
- name: Kick off integration tests.
run: |
pytest integration/
pytest test/
8 changes: 4 additions & 4 deletions .github/workflows/integration_sh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
SH_RUNNER_MANAGE_TOKEN: ${{secrets.SH_RUNNER_MANAGE_TOKEN }}

jobs:
# This job creates a self-hosted runner attached to the
# This job creates a self-hosted runner attached to the
# test organization.
Integration_SH_Runner:
name: Ephemeral Self-Hosted Runner
Expand All @@ -25,14 +25,14 @@ jobs:
mkdir actions-runner && cd actions-runner
curl -o actions-runner-linux-x64-2.300.2.tar.gz -L https://github.com/actions/runner/releases/download/v2.300.2/actions-runner-linux-x64-2.300.2.tar.gz
tar xzf ./actions-runner-linux-x64-2.300.2.tar.gz
python ../integration/runner_helper.py register
python ../test/runner_helper.py register
nohup ./run.sh &
- name: Sleep
run: python3 -c "import time; time.sleep(840)"
- name: Remove Runner
run: |
cd actions-runner
python ../integration/runner_helper.py remove
python ../test/runner_helper.py remove
SH_Runner_Cleanup:
# Removes the self-hosted runner forcibly in the event the cleanup operation
# did not work.
Expand All @@ -50,4 +50,4 @@ jobs:
- name: Force Remove SH Runner
run: |
pip install requests
python integration/runner_helper.py force_remove
python test/runner_helper.py force_remove
7 changes: 1 addition & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,8 @@ test = [
"pytest-cov"
]

[tool.setuptools]
py-modules = [
"gato"
]

[tool.pytest.ini_options]
testpaths = ["test"]
testpaths = ["unit_test"]
python_files = ["test_*.py"]
addopts = "--cov=gato"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion test/test_cli.py → unit_test/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ def test_attack_bad_args1(capfd):
def test_attack_bad_args2(capfd):
"""Test attack command with conflicting params.
"""
curr_path = pathlib.Path(__file__).parent.resolve()

with pytest.raises(SystemExit):
cli.cli(["attack", "-t", "test", "-pr",
"-f", "test/files/main.yaml", "-n", "invalid"])
"-f", os.path.join(curr_path, "files/main.yaml"), "-n", "invalid"])

out, err = capfd.readouterr()
assert "cannot be used with a custom" in err
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ecf3313

Please sign in to comment.