Skip to content

Commit

Permalink
Fix GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
charmoniumQ committed Mar 8, 2024
1 parent 2638ba6 commit cb05621
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ jobs:
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix develop --command ./ci.sh
env:
CLEAN_VM: 1
2 changes: 1 addition & 1 deletion ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mypy --package zilch

mypy tests/*.py

pytest
pytest -v

poetry build

Expand Down
3 changes: 3 additions & 0 deletions pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
set -ex

ruff check --fix .

mypy --package zilch

mypy tests/*.py

poetry build
14 changes: 9 additions & 5 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ def test_zilch_project_uses_cwd() -> None:
catch_exceptions=False,
)

@pytest.mark.skipif(not bool(int(os.environ.get("CLEAN_VM", "0"))), reason="Not running in CLEAN_VM")
@pytest.mark.skipif(
not bool(int(os.environ.get("CLEAN_VM", "0"))),
reason="Declining to run tests that modify $HOME because we are not running in CLEAN_VM",
)
def test_zilch_project_uses_global() -> None:
runner = CliRunner()
with runner.isolated_filesystem():
Expand All @@ -74,11 +77,12 @@ def test_search() -> None:
catch_exceptions=False,
)

package = "aria"
executable = "aria2c"
package = "hello"
executable = "hello"
which_executable = subprocess.run(["which", executable], check=False, capture_output=True)
@pytest.mark.skipif(
subprocess.run(["which", package], check=False, capture_output=True).returncode == 0,
reason=f"You have {package}, so we can't test its installation/removal",
which_executable.returncode == 0,
reason=f"You already have {package}, so we can't test its installation/removal. Try choosing a different package/executable",
)
def test_install_remove() -> None:
runner = CliRunner()
Expand Down

0 comments on commit cb05621

Please sign in to comment.