connectivity: display reason for skipping Tests and Scenarios #1933
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wanted to re-run a specific Test for reproducing a CI failure, but was surprised to see the test wouldn't run despite targeting it explicitly with --test. The test in question being north-south-loadbalancing, has a feature constraint that was not met in my environment. Thus began the printf rabbit hole.
This patch introduces skip reasons included in brackets after each skipped Test or Scenario. Currently, only one reason is shown, but care was taken to pick the most surprising reason for a skip. For example, excluding all tests by means of
--test "!.*"
would still display feature or version constraints despite the obvious test exclusion.Some example output (using '--test no-policies/pod-to-world'):
Since the amount of output generated by the connectivity tests has grown quite a bit since I last worked on it, I removed the first ct.Log() in ConnectivityTest.Skip() to make the output a little more compact.
RequiredCiliumVSN was renamed and changed to a string since storing the semver.Range does not allow communicating the original version constraint to the user.
A few internal methods on Test were shuffled around to keep concerns separated.