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

fixup e2e tests: wrong check during codemodules getInstaller inside provisioner #4347

Merged
merged 12 commits into from
Jan 28, 2025

Conversation

andriisoldatenko
Copy link
Contributor

@andriisoldatenko andriisoldatenko commented Jan 24, 2025

Description

This PR solves this problem:

provisioner {"level":"info","ts":"2025-01-24T09:03:30.872Z","logger":"csi-provisioner","msg":"reconciling DynaKube","namespace":"dynatrace","dyn
akube":"cloudnative-codemodules"}
provisioner {"level":"info","ts":"2025-01-24T09:03:30.888Z","logger":"oneagent-url","msg":"installing agent from url"}
provisioner {"level":"info","ts":"2025-01-24T09:03:30.888Z","logger":"oneagent-url","msg":"installing agent","target dir":"/data/codemodules/cHV
ibGljLmVjci5hd3MvZHluYXRyYWNlL2R5bmF0cmFjZS1jb2RlbW9kdWxlczoxLjMwNS45OS4yMDI1MDExNS0xMzMwMTQ="}
provisioner {"level":"info","ts":"2025-01-24T09:03:30.888Z","logger":"oneagent-url","msg":"downloading specific OneAgent package","version":"cus
tom-image"}
provisioner {"level":"info","ts":"2025-01-24T09:03:31.028Z","logger":"oneagent-url","msg":"failed to download specific OneAgent package","versio
n":"custom-image","available versions":["1.308.0.20250122-191256","1.308.0.20250114-220755","1.308.0.20250114-200919","1.308.0.20250113-094814",
1.307.3.20250113-131521","1.307.2.20250111-161133","1.307.0.20250109-202814","1.307.0.20250108-204709","1.307.0.20250108-093554","1.307.0.202501
08-070453","1.307.0.20250107-223844","1.307.0.20250107-101826","1.307.0.20250103-191526","1.307.0.20250103-113733","1.307.0.20250102-155459","1.
307.0.20250102-122620","1.307.0.20250102-090021","1.307.0.20250101-134504","1.307.0.20250101-070849","1.307.0.20241231-162719","1.307.0.20241227
-155221","1.307.0.20241226-155448"[]}
provisioner {"level":"info","ts":"2025-01-24T09:03:31.028Z","logger":"oneagent-url","msg":"failed to install agent","targetDir":"/data/codemodul
es/cHVibGljLmVjci5hd3MvZHluYXRyYWNlL2R5bmF0cmFjZS1jb2RlbW9kdWxlczoxLjMwNS45OS4yMDI1MDExNS0xMzMwMTQ="}
provisioner {"DynaKube":{"name":"cloudnative-codemodules","namespace":"dynatrace"},"controller":"provisioner-controller","controllerGroup":"dyna
trace.com","controllerKind":"DynaKube","error":"dynatrace server error 400: Invalid version","level":"error","logger":"main","msg":"Reconciler e
rror","name":"cloudnative-codemodules","namespace":"dynatrace","reconcileID":"3bf01bd6-73a3-40bb-a83a-384ee15e058e","stacktrace":"dynatrace serv
er error 400: Invalid version

How can this be tested?

run e2e tests:

make test/e2e/cloudnative/codemodules
make test/e2e/istio

@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.

Project coverage is 64.19%. Comparing base (c457ad0) to head (7df043c).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/controllers/csi/provisioner/install.go 84.21% 2 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4347   +/-   ##
=======================================
  Coverage   64.18%   64.19%           
=======================================
  Files         401      401           
  Lines       26327    26320    -7     
=======================================
- Hits        16897    16895    -2     
+ Misses       8125     8121    -4     
+ Partials     1305     1304    -1     
Flag Coverage Δ
unittests 64.19% <84.21%> (+<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.

waodim
waodim previously approved these changes Jan 24, 2025
Copy link
Contributor

@waodim waodim left a comment

Choose a reason for hiding this comment

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

ran the tests several times locally and they worked for me.

Copy link
Contributor

@aorcholski aorcholski left a comment

Choose a reason for hiding this comment

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

Tests work but still trying to understand the logic (I'm comparing rel-1.4, main before refactoring , main after CSI refactoring and the fix)

One more time:

=== RUN   TestIstio/cloudnative-csi-resilience/install_sample-apps
    app.go:151: 
        	Error Trace:	/home/a/dynatrace-operator/test/helpers/sample/app.go:151
                ...
        	Error:      	Received unexpected error:
        	           	client rate limiter Wait returned an error: rate: Wait(n=1) would exceed context deadline
        	Test:       	TestIstio/cloudnative-csi-resilience/install_sample-apps
=== RUN   TestIstio/cloudnative-csi-resilience/check_for_dummy_volume
    network_problems.go:103: 
        	Error Trace:	/home/a/dynatrace-operator/test/features/cloudnative/network_problems/network_problems.go:103
                ...
        	Error:      	Received unexpected error:
        	           	container "app" in pod "sample-dynakube-854dc5bbf5-47qcl" is waiting to start: PodInitializing
        	Test:       	TestIstio/cloudnative-csi-resilience/check_for_dummy_volume
        	=== RUN   TestIstio/cloudnative-csi-resilience/install_sample-apps
    app.go:151: 
        	Error Trace:	/home/a/dynatrace-operator/test/helpers/sample/app.go:151
                ...
        	Error:      	Received unexpected error:
        	           	client rate limiter Wait returned an error: rate: Wait(n=1) would exceed context deadline
        	Test:       	TestIstio/cloudnative-csi-resilience/install_sample-apps
=== RUN   TestIstio/cloudnative-csi-resilience/check_for_dummy_volume
    network_problems.go:103: 
        	Error Trace:	/home/a/dynatrace-operator/test/features/cloudnative/network_problems/network_problems.go:103
                ...
        	Error:      	Received unexpected error:
        	           	container "app" in pod "sample-dynakube-854dc5bbf5-47qcl" is waiting to start: PodInitializing
        	Test:       	TestIstio/cloudnative-csi-resilience/check_for_dummy_volume

pkg/controllers/csi/provisioner/install.go Outdated Show resolved Hide resolved
pkg/controllers/csi/provisioner/install.go Outdated Show resolved Hide resolved
aorcholski
aorcholski previously approved these changes Jan 24, 2025
Copy link
Contributor

@aorcholski aorcholski left a comment

Choose a reason for hiding this comment

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

Tests PASS (not sure if it is stable result)

0sewa0
0sewa0 previously approved these changes Jan 24, 2025
@0sewa0 0sewa0 dismissed stale reviews from aorcholski and themself via 6041844 January 27, 2025 08:03
0sewa0 and others added 3 commits January 27, 2025 09:22
We only used to check if the CodeModulesImage was set, nothing more.
It failed most recently because there was no case for the actual
default, which is just a Version in the Status.
@andriisoldatenko andriisoldatenko enabled auto-merge (squash) January 28, 2025 07:31
@andriisoldatenko andriisoldatenko merged commit 75bb367 into main Jan 28, 2025
14 checks passed
@andriisoldatenko andriisoldatenko deleted the fixup-e2e-wrong-status-version branch January 28, 2025 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Changes to or additional e2e/regression tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants