-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nr-k8s-otel-collector] Add unit tests (#1384)
<!-- Thank you for contributing to New Relic's Helm charts. Before you submit this PR we'd like to make sure you are aware of our technical requirements: * https://github.com/newrelic-experimental/helm-charts/blob/master/CONTRIBUTING.md#technical-requirements For a quick overview across what we will look at reviewing your PR, please read our review guidelines: * https://github.com/newrelic-experimental/helm-charts/blob/master/REVIEW_GUIDELINES.md Following our best practices right from the start will accelerate the review process and help get your PR merged quicker. When updates to your PR are requested, please add new commits and do not squash the history. This will make it easier to identify new changes. The PR will be squashed anyways when it is merged. Thanks. For fast feedback, please @-mention maintainers that are listed in the Chart.yaml file. Please make sure you test your changes before you push them. Once pushed, a Github Action will run across your changes and do some initial checks and linting. These checks run very quickly. Please check the results. We would like these checks to pass before we even continue reviewing your changes. --> #### Is this a new chart #### What this PR does / why we need it: #### Which issue this PR fixes *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)* - fixes #NR-268534 #### Special notes for your reviewer: #### Checklist [Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.] - [x] Chart Version bumped - [x] Variables are documented in the README.md - [x] Title of the PR starts with chart name (e.g. `[mychartname]`) --------- Co-authored-by: csongnr <[email protected]> Co-authored-by: chris <[email protected]>
- Loading branch information
1 parent
98dacc3
commit 476dcb2
Showing
15 changed files
with
1,335 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,314 @@ | ||
suite: affinity | ||
templates: | ||
- templates/deployment.yaml | ||
- templates/deployment-configmap.yaml | ||
- templates/daemonset.yaml | ||
- templates/daemonset-configmap.yaml | ||
release: | ||
name: my-release | ||
namespace: my-namespace | ||
tests: | ||
- it: sets affinity to default when no values provided | ||
set: | ||
cluster: my-cluster | ||
licenseKey: us-whatever | ||
asserts: | ||
- notExists: | ||
path: spec.template.spec.affinity | ||
template: templates/deployment.yaml | ||
- notExists: | ||
path: spec.template.spec.affinity | ||
template: templates/daemonset.yaml | ||
- it: sets affinity from global by common-library | ||
set: | ||
cluster: test-cluster | ||
licenseKey: us-whatever | ||
global: | ||
affinity: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: globalKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.affinity | ||
value: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: globalKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
template: templates/deployment.yaml | ||
- equal: | ||
path: spec.template.spec.affinity | ||
value: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: globalKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
template: templates/daemonset.yaml | ||
- it: sets affinity from values by common-library | ||
set: | ||
cluster: test-cluster | ||
licenseKey: us-whatever | ||
affinity: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: topLevelKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.affinity | ||
value: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: topLevelKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
template: templates/deployment.yaml | ||
- equal: | ||
path: spec.template.spec.affinity | ||
value: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: topLevelKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
template: templates/daemonset.yaml | ||
- it: sets affinity from values by common-library overriding global values | ||
set: | ||
cluster: test-cluster | ||
licenseKey: us-whatever | ||
affinity: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: topLevelKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
global: | ||
affinity: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: globalKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.affinity | ||
value: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: topLevelKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
template: templates/deployment.yaml | ||
- equal: | ||
path: spec.template.spec.affinity | ||
value: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: topLevelKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
template: templates/daemonset.yaml | ||
- it: sets affinity from deployment values | ||
set: | ||
cluster: test-cluster | ||
licenseKey: us-whatever | ||
deployment: | ||
affinity: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: deploymentKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.affinity | ||
value: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: deploymentKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
template: templates/deployment.yaml | ||
- it: sets affinity from daemonset values | ||
set: | ||
cluster: test-cluster | ||
licenseKey: us-whatever | ||
daemonset: | ||
affinity: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: daemonsetKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.affinity | ||
value: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: daemonsetKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
template: templates/daemonset.yaml | ||
- it: sets affinity from deployment values overriding top level and global values | ||
set: | ||
cluster: test-cluster | ||
licenseKey: us-whatever | ||
deployment: | ||
affinity: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: deploymentKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
affinity: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: topLevelKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
global: | ||
affinity: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: globalKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.affinity | ||
value: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: deploymentKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
template: templates/deployment.yaml | ||
- it: sets affinity from daemonset values overriding top level and global values | ||
set: | ||
cluster: test-cluster | ||
licenseKey: us-whatever | ||
daemonset: | ||
affinity: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: daemonsetKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
affinity: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: topLevelKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
global: | ||
affinity: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: globalKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.affinity | ||
value: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: daemonsetKey | ||
operator: In | ||
values: | ||
- S1 | ||
topologyKey: failure-domain.beta.kubernetes.io/zone | ||
template: templates/daemonset.yaml |
Oops, something went wrong.