Skip to content

Prototype Bazel-native FOSS tests - #209

Open
nettle wants to merge 6 commits into
Ericsson:mainfrom
nettle:bazel-foss
Open

Prototype Bazel-native FOSS tests#209
nettle wants to merge 6 commits into
Ericsson:mainfrom
nettle:bazel-foss

Conversation

@nettle

@nettle nettle commented Mar 28, 2026

Copy link
Copy Markdown
Collaborator

Why:
The existing Python/Bash FOSS tests are hard to
understand and extend, they are also very slow
and cannot be integrated into Bazel environment.

What:
Add test/bazel/ with a foss_test() macro
that generates py_test() targets for FOSS projects.

Test:
bazel test //test/bazel/...

@nettle
nettle requested review from Szelethus and furtib March 28, 2026 20:20
@nettle

nettle commented Mar 28, 2026

Copy link
Copy Markdown
Collaborator Author

Hi @furtib and @Szelethus,
I had a few minutes to demo Bazel approach for tests,
so please take a look - this is just very simple idea for FOSS tests.

@furtib furtib left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like the idea, haven't thought of it in this way.
But why do it in a separate folder?
(minor note, due to how the CI is set up, it doesn't actually run these tests)
It also does not work on the Bazel 6 version, since we don't use the WORKSPACE file at all.

Just now I realized, tests is only used to disable the per-file test in yaml-cpp?

Let me show what I'm thinking of. (tomorrow...)

Comment thread test/bazel/BUILD Outdated
Comment thread test/bazel/foss_test_runner.py Outdated
Comment thread test/bazel/foss_test_runner.py Outdated
Comment thread test/bazel/foss_test_runner.py Outdated
Comment thread test/bazel/BUILD Outdated

@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 like the approach! Would it be okay if, while preserving the main idea, we polished the PR up?

@nettle

nettle commented Mar 30, 2026

Copy link
Copy Markdown
Collaborator Author

The approach is actually questionable - run bazel from bazel.
So we should consider it very carefully.

Anyway, I have 2 conclusions in mind:

  1. We should develop bazel tests instead of python tests
  2. Even running bazel from bazel is better than bazel from python

@Szelethus

Szelethus commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

Sure! Lets think of a solution that is actionable and can be implemented incrementally. I don't mean this to come off the wrong way, but our bazel 8 support project showed how striving for perfection was the enemy of progress.

Our foss tests so far have borne some fruit, even if they are imperfect.

@furtib furtib mentioned this pull request Jun 9, 2026
@nettle
nettle force-pushed the bazel-foss branch 5 times, most recently from 3c9949d to fbfd8dd Compare August 21, 2026 20:18

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

Now that we are through the prototype phase, I suppose this can just replace the existing FOSS tests, right?

Also, whats the rationale behind the test/bazel/ directory instead of test/foss?

@furtib

furtib commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

To bring all FOSS into Bazel discussion here:
This PR in particular is good in terms of performance (~3x quicker than others). Other prototypes/experiments (#300 and #235) have extremely poor performance.

@nettle

nettle commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

Now that we are through the prototype phase, I suppose this can just replace the existing FOSS tests, right?

Also, whats the rationale behind the test/bazel/ directory instead of test/foss?

Agree, I will replace tests in test/foss with these bazel tests.

@nettle

nettle commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

To bring all FOSS into Bazel discussion here: This PR in particular is good in terms of performance (~3x quicker than others). Other prototypes/experiments (#300 and #235) have extremely poor performance.

Basically this is just setUpClass vs setUp bug.
I've left a comment in #300

nettle added 5 commits August 25, 2026 21:24
Why:
The existing Python/Bash FOSS tests are hard to
understand and extend, they are also very slow
and cannot be integrated into Bazel environment.

What:
Add test/bazel/ with a foss_test() macro
that generates sh_test() targets for FOSS projects.

Test:
bazel test //test/bazel/...

Convert to py_test()

Fix buildifier issues
@nettle
nettle force-pushed the bazel-foss branch 2 times, most recently from c690161 to 5414e74 Compare August 25, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants