Skip to content

Update template test#176

Open
furtib wants to merge 2 commits intoEricsson:mainfrom
furtib:fix-lint-template
Open

Update template test#176
furtib wants to merge 2 commits intoEricsson:mainfrom
furtib:fix-lint-template

Conversation

@furtib
Copy link
Contributor

@furtib furtib commented Jan 30, 2026

Why:
We want to provide a template in top shape to give a solid foundation for new tests.

What:

  • Removed extra spaces from the end of lines.
  • Removed bazel clean from setup class.
  • Added an example of how Bazel commands should be run. (Chose that specific target, since it is fast to run)

Addresses:
#153

@furtib furtib requested a review from Szelethus January 30, 2026 13:27
@furtib furtib self-assigned this Jan 30, 2026
@furtib furtib added non-functional change ☮️ The patch doesn't change any functionality, e.g. refactoring, documentation, test-only. test ☑️ Adding or refactoring tests labels Jan 30, 2026
@furtib furtib changed the title Spring clean of template test Update template test Feb 2, 2026
def setUpClass(cls):
"""TODO: Define set up before the test suite"""
super().setUpClass()
cls.run_command("bazel clean")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remember what was the rationale here when we added it?

Copy link
Contributor Author

@furtib furtib Feb 3, 2026

Choose a reason for hiding this comment

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

Yes, it was "this is in the legacy test, lets keep it".

A bit more indepth reason would be that since this rule is not (yet) hermetic, it should be cleaned between runs.
I argue against this, if tests are run on the same machine their output will be the same and unittests can only be run on a single machine.

Comment on lines +59 to +60
return_code, stdout, stderr = self.run_command("bazel build //src:*")
self.assertEqual(0, return_code, stderr)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the rationale behind this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since all test using this template will most certainly call a bazel build/test command, it makes sense to provide an example for it. The target was chosen for its minimal runtime.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since all test using this template will most certainly call a bazel build/test command, it makes sense to provide an example for it. The target was chosen for its minimal runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

non-functional change ☮️ The patch doesn't change any functionality, e.g. refactoring, documentation, test-only. test ☑️ Adding or refactoring tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants