Skip to content

Conversation

@Flamefire
Copy link
Contributor

@Flamefire Flamefire commented Jan 19, 2023

From #3790

We can use the more conventional @unittest.skipIf or self.skipTest markers to skip tests instead of C&P of conditions which might be wrong (some were)
An approach taken from IIRC PyTorch is to define own decorators requiresFoo as a wrapper around a specific skipIf which is reusable and easier to understand.

Only issue I can see is with the change to CI to ignore all skipped tests as now that I look at it previously we were able to selectively ignore some skipped tests.
So maybe we should not allow any skipped tests on CI which usually means installing additional Python packages. And for the tests requiring a github token we then need to resort back to the old approach but maybe we can still use a decorator here

@boegel boegel added the tests label Jan 21, 2023
@boegel boegel added this to the next release (4.7.1?) milestone Jan 21, 2023
@boegel
Copy link
Member

boegel commented Feb 1, 2023

Only issue I can see is with the change to CI to ignore all skipped tests as now that I look at it previously we were able to selectively ignore some skipped tests. So maybe we should not allow any skipped tests on CI which usually means installing additional Python packages. And for the tests requiring a github token we then need to resort back to the old approach but maybe we can still use a decorator here

@Flamefire How about only allowing \.s+ in the output when running the test suite in a PR?
Because only then should we allow skipped tests (because the GitHub token is missing)...

So we should conditionally extend IGNORE_PATTERNS with |\.s+ if the test suite is being triggered by a push to develop branch (I think)...

@Flamefire
Copy link
Contributor Author

So we should conditionally extend IGNORE_PATTERNS with |\.s+ if the test suite is being triggered by a push to develop branch (I think)...

I guess you meant to insert a NOT somewhere as no tests should be skipped on push to develop.

How about only allowing \.s+ in the output when running the test suite in a PR?
Because only then should we allow skipped tests (because the GitHub token is missing)...

Makes sense, however we should be more selective here. I hence added a dedicated decorator for that which doesn't produce output for PRs (i.e. silently succeeds) and make use of $FORCE_EB_GITHUB_TESTS to ensure github tests are run when the token is expected to be there.

@Flamefire Flamefire force-pushed the skip-markers branch 5 times, most recently from f76b45c to 65320fb Compare February 2, 2023 12:20
@Flamefire Flamefire changed the title Use skip markers and skipTest in tests Use skip markers in tests Feb 2, 2023
@Flamefire Flamefire force-pushed the skip-markers branch 7 times, most recently from 05c14fe to 2a38d1e Compare February 7, 2023 15:08
@easybuilders easybuilders deleted a comment from boegelbot Feb 15, 2023
@easybuilders easybuilders deleted a comment from boegelbot Feb 15, 2023
@easybuilders easybuilders deleted a comment from boegelbot Feb 15, 2023
@Flamefire Flamefire force-pushed the skip-markers branch 2 times, most recently from 4040414 to 149f7ec Compare May 11, 2023 08:56
@boegel boegel added this to the release after 5.1.2 (5.2.0?) milestone Sep 3, 2025
@Flamefire
Copy link
Contributor Author

Resolved

@Flamefire Flamefire force-pushed the skip-markers branch 3 times, most recently from 27abdeb to dc77998 Compare November 18, 2025 14:37
@boegel
Copy link
Member

boegel commented Nov 19, 2025

@Flamefire tests are failing now because some tests produces some unexpected (trace) output:

ERROR: Found printed messages in output of test suite
.................................................................................................................................................................................................................................................................................................................................s...........................................................................................................................s.................................................................s........................  >> loading toolchain module: intel-compilers/2024.0.0

@Flamefire
Copy link
Contributor Author

That's actually a side effect of the changed default for --trace in EB 5.

As we do a lot of stdout/stderr mocking and/or disabling it again in the tests I disabled it by default now.

If you want that separately: #5053

@Flamefire Flamefire force-pushed the skip-markers branch 2 times, most recently from 883121b to 54969a1 Compare November 21, 2025 08:50
@Flamefire
Copy link
Contributor Author

Flamefire commented Nov 21, 2025

Ok, the other skip sign was caused by an incomplete conflict resolution which was impossible to find with the current approach.
I force-pushed to fixup the conflict resolution failure directly

I added a list of skipped tests at the end. The expected ones should be marked with skip_silentCI* (used by e.g. requires_github_access). Unexpected ones will show up in this list in addition to the "s" chars in the short output.

We could on CI completely ignore ".s." (already done) and (instead of skip_silentCI) filter the "sometimes expected" failures in the CI config ($IGNORE_PATTERNS)

@Flamefire Flamefire force-pushed the skip-markers branch 2 times, most recently from 65fd048 to 480fcaa Compare November 21, 2025 12:11
@Flamefire
Copy link
Contributor Author

Rebased due to conflict by other PR

@boegel
Copy link
Member

boegel commented Dec 3, 2025

@Flamefire Needs more conflict resolving.

Sorry for dragging this on so long, it's a huge PR to review...

@Flamefire
Copy link
Contributor Author

Flamefire commented Dec 3, 2025

Rebased to fix

Sorry for dragging this on so long, it's a huge PR to review...

I know sorry for that. If you view the diff without whitespace changes it gets better at least

The pip-installable pysvn is incomplete and the full one is not easy to install.
Simply return if `$TEST_EASYBUILD_MODULES_TOOL` is not set to Lmod.
This avoids any "skip" output on CI
For PRs silently skip the tests when no token is available else use a skip.
On GHA force enable the tests when the source repo is 'easybuilds' so a
token is expected to be available.
As that is used a lot use that for better describing the purpose.
GC3Pie on Python 3.11 does not work: gc3pie/gc3pie#674
So avoid the skip mark for that.
On CI we don't want the full output of --verbose but fail when tests are
skipped.
This is only indicated by a "s" inbetween many dots.
So show a list of skipped tests and their reason at the end.
This also allows easy filtering.
Successful output looks like this
> ...............................................s......................................................................................
> ...................................................................................................................
> ----------------------------------------------------------------------
> Ran 946 tests in 714.512s
>
> OK (skipped=3)

We only care about the part until "Ran xxx tests" not including the divider (dashes).
Also we can ignore any lines with just "s" and ".".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants