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

feat(#8909): add CI jobs that run integration tests over a CHT launched in a K3D cluster #8978

Merged
merged 50 commits into from
Apr 26, 2024

Conversation

dianabarsan
Copy link
Member

@dianabarsan dianabarsan commented Mar 29, 2024

Description

Adds two CI jobs to run integration tests over K3D architecture, using specific helm charts and local-path for persistent storage.

#8909

Code review checklist

  • Readable: Concise, well named, follows the style guide, documented if necessary.
  • Documented: Configuration and user documentation on cht-docs
  • Tested: Unit and/or e2e where appropriate
  • Internationalised: All user facing text
  • Backwards compatible: Works with existing data and configuration or includes a migration. Any breaking changes documented in the release notes.

Compose URLs

If Build CI hasn't passed, these may 404:

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

@dianabarsan dianabarsan marked this pull request as ready for review April 2, 2024 15:07
@dianabarsan dianabarsan requested a review from nydr April 2, 2024 15:44
@dianabarsan
Copy link
Member Author

Hi @nydr . It would be great to get some feedback on this, if you have the bandwidth. Thanks a lot!

Copy link
Contributor

@nydr nydr left a comment

Choose a reason for hiding this comment

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

This is so cool! I was able to run the suite locally without much effort and I see a lot of potential here 😃

Am I correct in assuming a 30 minute extra build step is acceptable from a cost perspective?

I'm a bit concerned with the amount of potential false failures with flaky tests, if it becomes a big issue it might be worth considering skipping those by default in this suite.

Mostly minor comments, approving to unblock as I think it's good to merge as is. Overall impressive work!

tests/integration/couchdb/couch_chttpd.spec.js Outdated Show resolved Hide resolved
tests/utils/index.js Show resolved Hide resolved
tests/utils/index.js Outdated Show resolved Hide resolved
tests/utils/index.js Outdated Show resolved Hide resolved
tests/utils/index.js Outdated Show resolved Hide resolved
tests/utils/index.js Show resolved Hide resolved
tests/utils/index.js Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
.github/workflows/build.yml Show resolved Hide resolved
@dianabarsan
Copy link
Member Author

Hi @nydr
I addressed all comments and merged the templates into logical files.
In terms of context (re conversation the other day), it seems that k3d cluster create automatically switches default context to the new cluster. While I don't think it's an issue in CI, I'm wondering if we should try avoiding that for local runs, where the user might want to return to their previous context. Any ideas?

@dianabarsan dianabarsan requested a review from nydr April 17, 2024 19:21
@nydr
Copy link
Contributor

nydr commented Apr 18, 2024

if we should try avoiding that for local runs, where the user might want to return to their previous context. Any ideas?

That would make sense, looks like it should be something like k3c cluster create <cluster> -kubeconfig-update-default=false and --kubeconfig-switch-context might need to be set to false too

tests/utils/index.js Outdated Show resolved Hide resolved
tests/integration/.mocharc-k3d.js Outdated Show resolved Hide resolved
@dianabarsan dianabarsan changed the title feat(#8909): add CI job that runs integration tests over a CHT launched in a K3D cluster feat(#8909): add CI jobs that run integration tests over a CHT launched in a K3D cluster Apr 23, 2024
@dianabarsan dianabarsan requested a review from nydr April 25, 2024 07:16
@dianabarsan
Copy link
Member Author

I pushed a bunch of changes trying to stabilize and unify how the two systems work together. @nydr would you mind having a look?

Copy link
Contributor

@nydr nydr left a comment

Choose a reason for hiding this comment

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

LGTM assuming the test failures are due to flaky tests

As a sidenote, would it make sense to tag all flaky tests and run those as a separate step to speed up retries and highlight the tests with issues? I think they're quite disruptive but out of scope for this PR

'tests/integration/!(cht-conf|sentinel)/**/*.spec.js', // run everything except the sentinel tests - those are tested in .mocharc-sentinel.js
'tests/integration/cht-conf/**/*.spec.js', // Executing last to not side-effect sentinel tests.
],
spec: require('./specs').all,
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this format

* Watch expires after 10 seconds.
* @param {String} container - name of the container to watch
* @param {Boolean} tail - check logs with or without tailing
Copy link
Contributor

@nydr nydr Apr 26, 2024

Choose a reason for hiding this comment

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

Minor: I find this a bit confusing, I think it's ok to just describe what true does and then false is implied to be the inverse. Should it contain something like "always true for docker"? I generally don't like adding implementation details in docstrings, but I think it would be good to highlight that there's an override somehow

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't like this either.
The k3d container takes a longer time to start - compared to docker - and logs are cleared when the container starts. If I start watching logs before the container is up, in k3d I get an error. If I add a wait and retry, and the operation I'm waiting for happens immediately after container startup (this is the case), I could start watching the logs after the action had happened (this is also the case).

I'll add more info for the parameter.

@dianabarsan
Copy link
Member Author

LGTM assuming the test failures are due to flaky tests

I don't believe they are just flakes. I'm fixing them. It's been a journey....

@dianabarsan dianabarsan merged commit c8985c1 into master Apr 26, 2024
38 checks passed
@dianabarsan dianabarsan deleted the 8909-k8s-e2e branch April 26, 2024 16:36
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