Skip to content

Commit

Permalink
run tests on each CD build
Browse files Browse the repository at this point in the history
  • Loading branch information
BentonEdmondson committed Jul 17, 2024
1 parent 1df2f56 commit 0aa4005
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: cachix/install-nix-action@ba01fffc512be2cf5d4dce85159f0e40621f84ec
- run: nix run .#tests -- ./tests/workspace
- run: |
nix build
cp ./result/bin/knock knock.${{ matrix.target.kernel }}.${{ matrix.target.arch }}
Expand Down
8 changes: 4 additions & 4 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@

if not knock.exists():
print("error: " + str(knock) + " does not exist", file=sys.stderr)
sys.exit()
sys.exit(1)

if len(sys.argv) != 2:
print(
"error: missing required argument: directory in which to perform the tests",
file=sys.stderr,
)
sys.exit()
sys.exit(1)
workspace = Path(sys.argv[1])

print("Testing " + str(knock))

result = subprocess.run(knock)
if result.returncode != 0:
print("Test failed: knock failed to describe itself")
sys.exit()
sys.exit(1)
print("---")

html = requests.get(
Expand Down Expand Up @@ -63,7 +63,7 @@

if result.returncode != 0:
print("Test failed: knock failed to convert a file")
sys.exit()
sys.exit(1)

print("Success\n---")

Expand Down

0 comments on commit 0aa4005

Please sign in to comment.