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

Move basic e2e tests to new e2e and add upgrade scenario #95

Merged
merged 19 commits into from
Sep 18, 2023
Merged

Move basic e2e tests to new e2e and add upgrade scenario #95

merged 19 commits into from
Sep 18, 2023

Conversation

OliverMKing
Copy link
Collaborator

@OliverMKing OliverMKing commented Sep 7, 2023

Description

  • Moves a few tests to the new testing framework.
  • Adds framework for testing different operator versions and configurations
  • Swaps around a few things that weren't working (like how we track things happening in private clusters with the aks invoke api). AKS invoke api isn't good for long running operations.

What's left for e2e

  • Need to move a few more tests over (trivial since tests are fully working here)
  • Need to setup GitHub Action workflow to run tests
  • Add a little more documentation to how to use it after GitHub workflow is done. Add notes to release steps for adding new releases here.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Tested locally. You can too by running

cd testing/e2e/
go run ./main.go infra --subscription=<subscription> --tenant=<tenant> --names="basic cluster"
go run ./main.go deploy

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@OliverMKing OliverMKing changed the title Kingoliver/movetests Moves e2e tests to new testing framework Sep 7, 2023
@OliverMKing OliverMKing changed the title Moves e2e tests to new testing framework Move basic e2e tests to new testing framework Sep 7, 2023
@OliverMKing OliverMKing changed the title Move basic e2e tests to new testing framework Move basic e2e tests to new e2e and add upgrade scenario Sep 8, 2023
@coveralls
Copy link
Collaborator

coveralls commented Sep 8, 2023

Pull Request Test Coverage Report for Build 6164919630

  • 5 of 5 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 88.949%

Totals Coverage Status
Change from base Build 6089997898: 0.02%
Covered Lines: 1964
Relevant Lines: 2208

💛 - Coveralls

Copy link
Collaborator

@jaiveerk jaiveerk left a comment

Choose a reason for hiding this comment

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

very much left to go through but wanted to post these before the weekend.
excited to look through the rest!

docs/e2e.md Show resolved Hide resolved
docs/e2e.md Show resolved Hide resolved
testing/e2e/manifests/clientServer.go Show resolved Hide resolved
testing/e2e/manifests/clientServer.go Show resolved Hide resolved
@OliverMKing
Copy link
Collaborator Author

/ok-to-test sha=b43d23b

Copy link
Collaborator

@jaiveerk jaiveerk left a comment

Choose a reason for hiding this comment

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

lgtm for the most part, only request is if we can clean up test setup/running suites with different configs (even if that means, for instance, adding operator deploy scenario as an operator config or something else to consolidate information there)

docs/e2e.md Show resolved Hide resolved
testing/e2e/cmd/test.go Show resolved Hide resolved
testing/e2e/clients/acr.go Show resolved Hide resolved
testing/e2e/clients/aks.go Show resolved Hide resolved
testing/e2e/clients/aks.go Show resolved Hide resolved
testing/e2e/manifests/operator.go Show resolved Hide resolved
"github.com/Azure/aks-app-routing-operator/testing/e2e/manifests"
)

type cfgBuilder struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

absolutely love how thorough the documentation/comments have been throughout this PR - would you mind adding some brief descriptions here too? I think this is definitely a great practice that we should begin enforcing on future PRs

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

what exactly are you looking to be documented here? Tried to make it as self documenting as possible with the type system

testing/e2e/suites/operatorConfig.go Show resolved Hide resolved

type ordered []testsWithRunInfo

type testsWithRunInfo struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

there are lots of types here and it's a bit confusing to keep track of all the casting/movement of information which I imagine will make debugging a bit difficult - is there any way we can clean this up? This was mostly inspired by all the different types used in testing/e2e/tests/run.go

Copy link
Collaborator

Choose a reason for hiding this comment

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

realistically I'm not sure how exactly this will take place but happy to chat about what my specific pain points are - just a lot of mixes between lists and types that contain lists, similar names, etc etc - I just feel like it can be cleaner/that we can consolidate a lot of the information that is repeatedly moving around

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it's definitely a lot but using more times makes this simpler in this case. Using separate types to move information up means we can take away information making it easier to develop with.

If you can think of a specific way to improve this I'm happy to implement that in the future but this is the best I have for now.

// group tests by operator configuration
operatorCfgSet := make(map[manifests.OperatorConfig][]testWithConfig)
for _, test := range operatorVersionSet[version] {
operatorCfgSet[test.config] = append(operatorCfgSet[test.config], test)
Copy link
Collaborator

Choose a reason for hiding this comment

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

re: my comment in types... this is a lot

Copy link
Collaborator

@jaiveerk jaiveerk left a comment

Choose a reason for hiding this comment

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

approving changes per discussion/call

@OliverMKing OliverMKing merged commit 8df1e40 into Azure:main Sep 18, 2023
7 checks passed
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.

4 participants