Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2.3.2] Don't retry tests at the GHA level #4281

Merged
merged 7 commits into from Jun 15, 2022
Merged

Conversation

LukeShu
Copy link
Contributor

@LukeShu LukeShu commented Jun 14, 2022

Description

Stop using the nick-invision/retry@v2.4.0 GitHub action to retry tests. Besides test retries being bad (they're there for the case that the test intermittently flakes, but mask the case that the code-under-test only intermittently works), this action in particular is problematic: It has a bug (nick-fields/retry#76) where if there is too much output it marks the test as passing even if it fails. That is very bad, and we cannot permit that type of failure mode in our CI.

This reveals a number of tests that were failing but we didn't know it. Spend several commits fixing those.

Testing

That's pretty much all this is.

Checklist

  • I made sure to update CHANGELOG.md. - no applicable changes

    Remember, the CHANGELOG needs to mention:

    • Any new features
    • Any changes to our included version of Envoy
    • Any non-backward-compatible changes
    • Any deprecations
  • This is unlikely to impact how Ambassador performs at scale.

    Remember, things that might have an impact at scale include:

    • Any significant changes in memory use that might require adjusting the memory limits
    • Any significant changes in CPU use that might require adjusting the CPU limits
    • Anything that might change how many replicas users should use
    • Changes that impact data-plane latency/scalability
  • My change is adequately tested.

    Remember when considering testing:

    • Your change needs to be specifically covered by tests.
      • Tests need to cover all the states where your change is relevant: for example, if you add a behavior that can be enabled or disabled, you'll need tests that cover the enabled case and tests that cover the disabled case. It's not sufficient just to test with the behavior enabled.
    • You also need to make sure that the entire area being changed has adequate test coverage.
      • If existing tests don't actually cover the entire area being changed, add tests.
      • This applies even for aspects of the area that you're not changing – check the test coverage, and improve it if needed!
    • We should lean on the bulk of code being covered by unit tests, but...
    • ... an end-to-end test should cover the integration points
  • I updated DEVELOPING.md with any any special dev tricks I had to use to work on this code efficiently. - no tricks

  • The changes in this PR have been reviewed for security concerns and adherence to security best practices.

LukeShu and others added 7 commits June 14, 2022 17:11
Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Besides test retries being bad (they're there for the case that the test
intermittently flakes, but mask the case that the code-under-test only
intermittently works), this is important in order to remove the
`nick-invision/retry@v2.4.0` GitHub action.  It has a bug where if there
is too much output it marks the test as passing even if it fails.  That is
very bad, and we cannot permit that type of failure mode in our CI.

nick-fields/retry#76

Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
fetcher.py's parse_watt() calls `watt_k8s.pop('annotations') or {}` to
pluck the annotations out of the watt snapshot.  Because the `pop`
call does not include a default this causes it to throw a KeyError
when `annotations` doesn't exist.  This isn't an issue in normal use,
as `pkg/snapshot/v1/types.go` doesn't say `,omitempty` on that field,
so it will always be present.  However this does cause a problem for
many of the unit tests, which don't set that field.  So, move the
default value to inside of the call to `pop`.

Signed-off-by: Lance Austin <laustin@datawire.io>
Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
The test YAML parser doesn't need to be told about Namespaces; and indeed
it chokes on them because they don't have a `.metadata.namespace`.

Also, you can't multi-assign from a bool.

Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Remove the Python unit test for testing annotation parsing because it
is already being tested in `pkg/snapshot/v1/annotations_test.go`.

However, the Go version is missing tests for the following use cases:

- "getambassador.io/config" annotation is empty
- "getambassador.io/config" is empty missing

So add those 2 cases to the Go test.

Signed-off-by: Lance Austin <laustin@datawire.io>
Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Fixes: 417a831

Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Make it clear that "XXX" in this case means that something is wrong.

Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
@LukeShu LukeShu marked this pull request as ready for review June 15, 2022 20:47
Copy link
Contributor

@LanceEa LanceEa left a comment

Choose a reason for hiding this comment

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

lgtm...once CI turns green.

@LukeShu LukeShu merged commit fd0aff9 into release/v2.3 Jun 15, 2022
@LukeShu LukeShu deleted the lukeshu/no-gha-retry branch June 15, 2022 21:09
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.

None yet

2 participants