Skip to content

test: Migrate parse test into bazel - #329

Open
furtib wants to merge 2 commits into
Ericsson:mainfrom
furtib:test_into_bazel_004
Open

furtib wants to merge 2 commits into
Ericsson:mainfrom
furtib:test_into_bazel_004

Conversation

@furtib

@furtib furtib commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Why:
We want all tests to be run with bazel test //....

What:

  • Migrated parse tests into Bazel.

Note:
--zip-loc is only available since CodeChecker 6.27.x

Addresses:
#210

@furtib
furtib force-pushed the test_into_bazel_004 branch from 12cc401 to ce5ec7b Compare September 23, 2026 16:14

@Szelethus Szelethus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I really like the test targets in BUILD. I suppose when its reasonable, it pays to adhere to the builtin py_test rule.

I respect that CodeChecker store/parse are very different from most of the other tests (similarly to external deps), so some leniency is in order.

# Basename of the analysis output directory produced by codechecker_test.
REPORT_DIR_NAME = "codechecker-files"

def resolve_report_data(paths: list[str]) -> str:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This seems quite a bit of logic for a test. Is it that impossible to know the location of the directory to parse?

Comment on lines +164 to +170
"store",
report_dir,
"-n",
name,
f"--url=http://localhost:{port}/Default",
"--zip-loc",
zip_loc,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this mandated by pylint? Some grouping would be nicer.

Suggested change
"store",
report_dir,
"-n",
name,
f"--url=http://localhost:{port}/Default",
"--zip-loc",
zip_loc,
"store",
report_dir,
"-n", name,
f"--url=http://localhost:{port}/Default",
"--zip-loc", zip_loc,

"""
Stops the CodeChecker server started by start_codechecker_server
"""
# Idempotent: the object is also stopped from __del__, so avoid

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That raises questions whether __del__ is helping or hindering the cleanup.

This branch has not been deployed

No deployments
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