Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

✨ [Add] Coverage dir for unpack pod #884

Merged
merged 1 commit into from
May 10, 2024

Conversation

varshaprasad96
Copy link
Member

This PR adds the go test coverage variable to the
unpack pod. It also creates necessary volumes
if the GOCOVERDIR env var is set.

@varshaprasad96 varshaprasad96 requested a review from a team as a code owner May 10, 2024 07:35
WithVolumeMounts(func() []*applyconfigurationcorev1.VolumeMountApplyConfiguration {
var volumeMounts []*applyconfigurationcorev1.VolumeMountApplyConfiguration
if gocoverdirEnv != "" {
volumeMounts = append(volumeMounts, applyconfigurationcorev1.VolumeMount().
Copy link
Member Author

Choose a reason for hiding this comment

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

A temporary fix to get e2e's running in operator controller!

Copy link

codecov bot commented May 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.27%. Comparing base (d747ca9) to head (35b95ac).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #884   +/-   ##
=======================================
  Coverage   37.27%   37.27%           
=======================================
  Files           9        9           
  Lines         845      845           
=======================================
  Hits          315      315           
  Misses        486      486           
  Partials       44       44           

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

pkg/source/image.go Outdated Show resolved Hide resolved
pkg/source/image.go Outdated Show resolved Hide resolved
WithMountPath("/bin"))
return volumeMounts
}()...).
WithEnv(applyconfigurationcorev1.EnvVar().WithName("GOCOVERDIR").WithValue(gocoverdirEnv)).
Copy link
Member

Choose a reason for hiding this comment

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

Can we only set this if gocoverdirEnv != ""?

Copy link
Member Author

Choose a reason for hiding this comment

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

Passing an empty configuration is causing errors. Tried various options, but looks like the only one is to create the entire container spec separately based on whether env var is present or not.

Leaving it to be as is for now, if the env is not set it results in an empty string which doesn't cause a problem for now. Also this is just a band aid, and will replaced by direct registry client anyways.

everettraven
everettraven previously approved these changes May 10, 2024
everettraven
everettraven previously approved these changes May 10, 2024
joelanford
joelanford previously approved these changes May 10, 2024
@joelanford joelanford enabled auto-merge May 10, 2024 18:41
tmshort
tmshort previously approved these changes May 10, 2024
Copy link
Contributor

@tmshort tmshort left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 10, 2024
This PR adds the go test coverage variable to the
unpack pod. It also creates necessary volumes
if the GOCOVERDIR env var is set.

Signed-off-by: Varsha Prasad Narsing <[email protected]>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label May 10, 2024
@tmshort
Copy link
Contributor

tmshort commented May 10, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 10, 2024
@joelanford joelanford added this pull request to the merge queue May 10, 2024
Merged via the queue into operator-framework:main with commit 99faf1c May 10, 2024
10 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants