Skip to content

Create a unit_test macro for tests that assert on output files#213

Open
furtib wants to merge 13 commits intoEricsson:mainfrom
furtib:test_into_bazel_001
Open

Create a unit_test macro for tests that assert on output files#213
furtib wants to merge 13 commits intoEricsson:mainfrom
furtib:test_into_bazel_001

Conversation

@furtib
Copy link
Copy Markdown
Contributor

@furtib furtib commented Mar 31, 2026

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.
  • Demonstrated its use in legacy and virtual include tests.

Addresses:
#210

@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 added 4 commits March 31, 2026 22:43
Since tests are not being invoked from a python file anymore we need to
run bazel test //...
@furtib furtib force-pushed the test_into_bazel_001 branch from 01027e4 to 3013225 Compare April 1, 2026 04:40
Copy link
Copy Markdown
Collaborator

@nettle nettle left a comment

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
Comment on lines +36 to +37
"//test/unit:unit_test.bzl",
"unit_test",
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.

Please dont touch "my" legacy tests so far :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay, I will revert them.

Comment thread test/unit/BUILD
# See the License for the specific language governing permissions and
# limitations under the License.

exports_files(["grep_check.py"])
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 guess this should not be needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch.

@furtib
Copy link
Copy Markdown
Contributor Author

furtib commented Apr 7, 2026

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

I'm completely lost as to what this means.

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