Skip to content
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

fix integration tests #3

Merged
merged 3 commits into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
on:
pull_request:
types:
- opened
push:
branches:
- main
Expand Down
8 changes: 6 additions & 2 deletions tests/test_archives.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import shlex
import shutil
import subprocess
import sys
import unittest

import yaml
Expand Down Expand Up @@ -122,7 +123,9 @@ def test(self):
with open(f'{ARTIFACTS_DIR}/fup.yml', 'wt') as fd:
yaml.dump(config, Dumper=yaml.SafeDumper, stream=fd)

cmd = shlex.split(f'fup -p archive -f {ARTIFACTS_DIR}/fup.yml -b')
go_path = os.getenv('GOPATH', os.path.expanduser('~/go'))
fup_bin = os.path.join(go_path, 'bin', 'fup')
cmd = shlex.split(f'{fup_bin} -p archive -f {ARTIFACTS_DIR}/fup.yml -b')
proc = subprocess.run(cmd)
self.assertTrue(proc.returncode == 0)

Expand All @@ -137,4 +140,5 @@ def test(self):
for case in TESTS_CASES:
test_method = gen_test(case)
setattr(BaseTestCase, f'test_{case.name}', test_method)
unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromTestCase(BaseTestCase))
if not unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromTestCase(BaseTestCase)).wasSuccessful():
sys.exit(1)