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

capgen unit tests broken in main branch #497

Closed
climbfuji opened this issue Sep 7, 2023 · 0 comments · Fixed by #498
Closed

capgen unit tests broken in main branch #497

climbfuji opened this issue Sep 7, 2023 · 0 comments · Fixed by #498
Assignees

Comments

@climbfuji
Copy link
Collaborator

Description

The capgen unit tests are broken in the main branch:

Everything ok up to unit testing common.py:

..E..
======================================================================
ERROR: test_execute (__main__.CommonTestCase)
Test execute() function
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/heinzell/work/ccpp-framework/ccpp-framework/test/unit_tests/test_common.py", line 41, in test_execute
    self.assertEqual(common.execute(f"ls {TEST_FILE}"),(0,f"{TEST_FILE}",""))
  File "/Users/heinzell/work/ccpp-framework/ccpp-framework/scripts/common.py", line 98, in execute
    raise Exception(message)
Exception: Execution of command ls test_common.py failed, exit code 1
    stdout: ""
    stderr: "ls: test_common.py: No such file or directory"

----------------------------------------------------------------------
Ran 5 tests in 0.032s

FAILED (errors=1)

Solution

Clearly a bug, because the test assumes that the file is in the local directory where the tests are executed, which is not the case if you run run_tests.sh in directory ./test. Simple fix is to use os.path.abspath.

Alternatives (optional)

n/a

Related to (optional)

n/a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant