mongodb-atlas-kubernetes icon indicating copy to clipboard operation
mongodb-atlas-kubernetes copied to clipboard

[skunkworks] Auditing contract testing

Open josvazg opened this issue 1 year ago • 1 comments

These is the sample "foundations" PR of a new feature. It does NOT add anything that cannot be merged ASAP. Will hold it as it is a PoC.

It includes:

  • Auditing translation layer at internal/translayer/auditing.
  • Contract tests for the translation layer at test/contract/auditing.

Screenshot 2024-05-15 at 09 03 46

Infrastructure that had to be added as a one off, if this approach is followed, next PRs like will not need it:

  • Contract tests workflow and wiring from cloud tests:
    • .github/workflows/contract-tests.yml & .github/workflows/cloud-tests.yml
  • Added a rule for contract tests to the Makefile.
  • Client building function for translation layer services at internal/translater/client.go.
  • Launcher infrastructure for contract tests at test/helper/launcher.
    • Comes from earlier PoC #1487.
  • A minor improvement for skipping tests at test/helper/control/enable.go.
    • And its new usages.

Engineering Proposal: Translation Layer

All Submissions:

  • [X] Have you signed our CLA?

josvazg avatar May 14 '24 15:05 josvazg

https://app.codecov.io/github/mongodb/mongodb-atlas-kubernetes/commit/d94928b66c9fb41bd2731a99c2768c4bdb0797ec

github-actions[bot] avatar May 14 '24 16:05 github-actions[bot]

The setup of the env, using Kind and the operator itself to prepare things for the test doesn't make me happy. Don't you think that using the Atlas client directly is a better idea? Like this, the contract test would have zero dependencies to be run.

This way we are dogfooding, we depend on us.

I did a try without the operator and it got quite complex. Note we need not only provide a project, or a project and a deployment, but arbitrary setups, which the operator can do just by passing it a YAML input file.

I think my old attempt is there closed somewhere.

josvazg avatar May 31 '24 16:05 josvazg

@helderjs I found my old attempt, see that is ugly as hell: https://github.com/mongodb/mongodb-atlas-kubernetes/pull/1438

Do you have something else in mind?

josvazg avatar May 31 '24 16:05 josvazg

@s-urbaniak I believe I applied all your feedback.

josvazg avatar Jun 04 '24 12:06 josvazg

Related to CLOUDP-242997

josvazg avatar Jun 04 '24 15:06 josvazg