Skip to content

tests: rewrite in go and simplify TLSChallengeTest#12292

Merged
porridge merged 5 commits intomasterfrom
porridge/tls-challenge-test-go-2
Aug 7, 2024
Merged

tests: rewrite in go and simplify TLSChallengeTest#12292
porridge merged 5 commits intomasterfrom
porridge/tls-challenge-test-go-2

Conversation

@porridge
Copy link
Copy Markdown
Contributor

@porridge porridge commented Aug 6, 2024

Description

This supersedes #11986 which accumulated hundreds of retry comments making it hard to follow the review thread.

TLSChallengeTest is currently by far the most flaky test owned by draco team. Rather than invest more time into debugging the groovy test and the k8s interface library (where the problem seems to lie) I decided to kill two birds with one stone and rewrite this test in Go. This starts to pave the road towards creating an improved e2e testing framework for nongroovy.

While rewriting I also reused the additional CA already in use for TestCASetup which speeds up and simplifies the test considerably.

This PR resolves:

User-facing documentation

(must be 2 items and both must be checked)

  • CHANGELOG update is not needed
  • Documentation is not needed

Testing

  • inspected CI results

Automated testing

(must be at least 1 item and all items must be checked)

  • added e2e tests
  • modified existing tests

How I validated my change

CI should be enough. I had the bot re-run this test a few times and saw a single related flake that I'm addressing in #12305. The other failures seem unrelated (collector crash, Test_ComplianceOperatorScanConfigSync failure, and a stackrox setup failure on GKE).

@gitguardian
Copy link
Copy Markdown

gitguardian bot commented Aug 6, 2024

⚠️ GitGuardian has uncovered 3 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
13057026 Triggered RSA Private Key 355cb3b qa-tests-backend/artifacts/tls-challenge-test/nginx-lb-certs/leaf-key.pem View secret
13057027 Triggered Generic Private Key 355cb3b qa-tests-backend/artifacts/tls-challenge-test/nginx-lb-certs/ca-key.pem View secret
13125931 Triggered Generic Private Key 355cb3b tests/bad-ca/nginx-loadbalancer.qa-tls-challenge.key View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@rhacs-bot
Copy link
Copy Markdown
Contributor

Images are ready for the commit at 2787256.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.6.x-246-g2787256c2e.

@porridge porridge added the auto-retest PRs with this label will be automatically retested if prow checks fails label Aug 6, 2024
@porridge
Copy link
Copy Markdown
Contributor Author

porridge commented Aug 6, 2024

/retest-times 5 gke-nongroovy-e2e-tests
/retest-times 5 ocp-4-12-nongroovy-e2e-tests
/retest-times 5 ocp-4-16-nongroovy-e2e-tests

@porridge porridge requested a review from janisz August 6, 2024 12:03
@rhacs-bot
Copy link
Copy Markdown
Contributor

/test gke-nongroovy-e2e-tests
/test ocp-4-12-nongroovy-e2e-tests
/test ocp-4-16-nongroovy-e2e-tests

@porridge
Copy link
Copy Markdown
Contributor Author

porridge commented Aug 6, 2024

/test gke-sensor-integration-tests

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.27%. Comparing base (43e13e2) to head (fa0fb0b).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #12292   +/-   ##
=======================================
  Coverage   48.27%   48.27%           
=======================================
  Files        2402     2402           
  Lines      171574   171570    -4     
=======================================
+ Hits        82820    82825    +5     
+ Misses      82066    82059    -7     
+ Partials     6688     6686    -2     
Flag Coverage Δ
go-unit-tests 48.27% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rhacs-bot
Copy link
Copy Markdown
Contributor

rhacs-bot commented Aug 6, 2024

Images are ready for the commit at fa0fb0b.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.6.x-248-gfa0fb0b6ef.

@porridge
Copy link
Copy Markdown
Contributor Author

porridge commented Aug 6, 2024

Comments addressed, PTAL @janisz

@rhacs-bot
Copy link
Copy Markdown
Contributor

/test gke-nongroovy-e2e-tests

@rhacs-bot
Copy link
Copy Markdown
Contributor

/test ocp-4-12-nongroovy-e2e-tests

@rhacs-bot
Copy link
Copy Markdown
Contributor

/test ocp-4-16-nongroovy-e2e-tests

@rhacs-bot
Copy link
Copy Markdown
Contributor

/test ocp-4-12-nongroovy-e2e-tests

@porridge
Copy link
Copy Markdown
Contributor Author

porridge commented Aug 6, 2024

/retest

@rhacs-bot
Copy link
Copy Markdown
Contributor

/test gke-nongroovy-e2e-tests

@rhacs-bot
Copy link
Copy Markdown
Contributor

/test ocp-4-12-nongroovy-e2e-tests

@rhacs-bot
Copy link
Copy Markdown
Contributor

/test gke-nongroovy-e2e-tests

@rhacs-bot
Copy link
Copy Markdown
Contributor

/test ocp-4-16-nongroovy-e2e-tests

@rhacs-bot
Copy link
Copy Markdown
Contributor

/test gke-nongroovy-e2e-tests

@rhacs-bot
Copy link
Copy Markdown
Contributor

/test ocp-4-12-nongroovy-e2e-tests

@rhacs-bot
Copy link
Copy Markdown
Contributor

/test ocp-4-16-nongroovy-e2e-tests

1 similar comment
@rhacs-bot
Copy link
Copy Markdown
Contributor

/test ocp-4-16-nongroovy-e2e-tests

@porridge porridge requested a review from janisz August 7, 2024 05:11
Copy link
Copy Markdown
Contributor

@janisz janisz left a comment

Choose a reason for hiding this comment

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

LGTM, except shadowing const when it's not needed

@porridge porridge merged commit 919281b into master Aug 7, 2024
@porridge porridge deleted the porridge/tls-challenge-test-go-2 branch August 7, 2024 08:38
shireenf-ibm pushed a commit to shireenf-ibm/stackrox that referenced this pull request Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-retest PRs with this label will be automatically retested if prow checks fails

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants