Skip to content

Comments

Make FOSS tests more convenient to use#169

Open
furtib wants to merge 11 commits intoEricsson:mainfrom
furtib:foss_test_refactor
Open

Make FOSS tests more convenient to use#169
furtib wants to merge 11 commits intoEricsson:mainfrom
furtib:foss_test_refactor

Conversation

@furtib
Copy link
Contributor

@furtib furtib commented Jan 26, 2026

Why:
FOSS tests left behind a lot of artifacts, which in certain cases blocked the test from running (e.g., after changing bazel version).

What:

  • Added a temporary directory class to common
  • modified test_foss.py to run each test in a temporary folder
  • modified init.sh files to work with temporary folders
  • removed foss test-specific folders from git ignore
  • Updated README.md to reflect these changes

Addresses:
#148

@furtib furtib requested review from Szelethus and nettle January 26, 2026 17:24
@furtib furtib self-assigned this Jan 26, 2026
@furtib furtib added the test ☑️ Adding or refactoring tests label Jan 26, 2026
@furtib furtib force-pushed the foss_test_refactor branch 3 times, most recently from 218b0ef to 86d6d8a Compare January 27, 2026 08:23
import tempfile


class TemporaryDir:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not aware of this. Fixed.

@furtib furtib force-pushed the foss_test_refactor branch from 86d6d8a to f74ec27 Compare February 3, 2026 15:59
@furtib furtib requested a review from Szelethus February 4, 2026 09:16
Copy link
Contributor

@Szelethus Szelethus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to have a bit more verbosity from the unit test, e.g. "Setting up project XYZ...". I'm running pytest test/foss/ --capture=no and seeing nothing.

@nettle, since you mentioned as an annoying issue, what do you think of this rework?

- Clone the test project into a folder, its path will be the first command line argument.
- To ensure the project doesn't change over time, check out a specific tag or commit instead of a branch!
- Copy the .bazelversion file from the templates directory into the test-proj directory.
- Copy the .bazelversion file, if it exists, from the root of codechecker_bazel into the projects directory.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading only the documentation it might not be obvious when does it ever exist.

@furtib furtib force-pushed the foss_test_refactor branch from d68c96a to f977090 Compare February 24, 2026 09:51
@furtib furtib requested a review from Szelethus February 24, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test ☑️ Adding or refactoring tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants