Skip to content

Create a unit_test macro - #213

Merged
Szelethus merged 25 commits into
Ericsson:mainfrom
furtib:test_into_bazel_001
Jun 30, 2026
Merged

Szelethus merged 25 commits into
Ericsson:mainfrom
furtib:test_into_bazel_001

Conversation

@furtib

@furtib furtib commented Mar 31, 2026 •

Copy link
Copy Markdown
Contributor

Why:
We want to integrate our tests into Bazel.

What:

  • Added a Python script that checks whether specified patterns are available inside a file or a list of files.
  • Added a Bazel macro for creating a test using said Python file.
  • Updated template test
  • Updated test documentation

Addresses:
#210

Notes:
In very old Bazel versions (older than 6.4.0), bazel test ... must get the flag: --experimental_cc_implementation_deps.

@furtib
furtib requested a review from Szelethus March 31, 2026 20:41
@furtib furtib self-assigned this Mar 31, 2026
@furtib furtib added the test ☑️ Adding or refactoring tests label Mar 31, 2026
@furtib
furtib force-pushed the test_into_bazel_001 branch from 01027e4 to 3013225 Compare April 1, 2026 04:40

@nettle nettle 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 like the idea!
However I would consider not mixing python tests and bazel tests.
But as a prototype it is definitely good!
And, as @Szelethus mentioned, we need a strategy for bazel tests.
And... please dont touch legacy tests - I need them as the reference!

Comment thread test/unit/legacy/BUILD Outdated
Comment thread test/unit/BUILD
@furtib

furtib commented Apr 7, 2026 •

Copy link
Copy Markdown
Contributor Author

However I would consider not mixing python tests and bazel tests.

I'm completely lost as to what this means.

@furtib
furtib force-pushed the test_into_bazel_001 branch from ffeae11 to 3e71779 Compare June 10, 2026 07:44
@furtib
furtib marked this pull request as draft June 10, 2026 07:45
@furtib
furtib force-pushed the test_into_bazel_001 branch 2 times, most recently from f578d76 to 41ccf6b Compare June 10, 2026 11:52
@furtib
furtib marked this pull request as ready for review June 10, 2026 13:46
@furtib furtib changed the title Create a unit_test macro for tests that assert on output files Create a unit_test macro Jun 10, 2026
@furtib

furtib commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

I have left this patch alone for a long time 😅.

So I realized that almost every unit test (except cache tests) is convertable to this format.
I'm still not sure about what you meant under "not mixing python tests and bazel tests", but hopefully I have fixed it?

@furtib
furtib requested a review from nettle June 10, 2026 13:59

@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 don't think the PR name is very descriptive right now, because it adds a new macro, and demonstrates the usage on the virtual include tests.

I hate to be that guy (twice in one day), but can we fragment this just a little bit more? Can you at least put the test rewrite demo to a separate PR?

I like the overall direction, btw. Lets make sure we discuss with @nettle to avoid sinking too much effort into an idea that won't make the cut.

Comment thread .github/workflows/unit_test.yaml
Comment thread test/unit/virtual_include/BUILD Outdated
Comment thread test/unit/unit_test.bzl Outdated
@furtib
furtib force-pushed the test_into_bazel_001 branch from e06ad27 to 36fd666 Compare June 16, 2026 05:09

@nettle nettle 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.

In general I like the idea :)

Comment thread test/unit/grep_check.py Outdated
Comment thread test/unit/basic/BUILD

@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.

LGTM

@Szelethus
Szelethus merged commit fe29339 into Ericsson:main Jun 30, 2026
7 checks passed
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.

3 participants