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

Add Failed Pod - Container Pending Test #849

Merged
merged 7 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### enhancement
- Update E2E resources by @juanjjaramillo in [#926](https://github.com/newrelic/nri-kubernetes/pull/926)
- Add failed pod container pending e2e tests in [#849](https://github.com/newrelic/nri-kubernetes/pull/849)
- Add failed pod container creating e2e tests in [#848](https://github.com/newrelic/nri-kubernetes/pull/848)
- Add cronjob dashboard tests in [#827](https://github.com/newrelic/nri-kubernetes/pull/827)

Expand Down
44 changes: 44 additions & 0 deletions e2e/test-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,28 @@ scenarios:
- helm delete ${SCENARIO_TAG} -n nr-${SCENARIO_TAG}
tests:
nrqls:
# START Failed Pod - Container Pending
- query: "FROM Metric SELECT latest(if(k8s.pod.isReady = 1, 'True', 'False')) as 'Ready' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Ready"
value: False
- query: "FROM Metric SELECT latest(if(k8s.pod.isScheduled = 1, 'True', 'False')) as 'Scheduled' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Scheduled"
value: False
- query: "FROM Metric SELECT latest(k8s.pod.createdAt) as 'Created At' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Created At"
lowerBoundedValue: 0.0
- query: "FROM Metric SELECT latest(k8s.nodeName) as 'Node Name' WHERE metricName = 'k8s.pod.createdAt' AND k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Node Name"
value: ""
- query: "FROM Metric SELECT max(k8s.container.restartCountDelta) AS 'Restart count' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Restart count"
value: nil
# END Failed Pod - Container Pending
# START Failed Pod - Container Creating
- query: "FROM Metric SELECT latest(if(k8s.pod.isReady = 1, 'True', 'False')) as 'Ready' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-creating'"
expected_results:
Expand Down Expand Up @@ -250,6 +272,28 @@ scenarios:
- helm delete ${SCENARIO_TAG} -n nr-${SCENARIO_TAG}
tests:
nrqls:
# START Failed Pod - Container Pending
- query: "FROM Metric SELECT latest(if(k8s.pod.isReady = 1, 'True', 'False')) as 'Ready' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Ready"
value: False
- query: "FROM Metric SELECT latest(if(k8s.pod.isScheduled = 1, 'True', 'False')) as 'Scheduled' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Scheduled"
value: False
- query: "FROM Metric SELECT latest(k8s.pod.createdAt) as 'Created At' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Created At"
lowerBoundedValue: 0.0
- query: "FROM Metric SELECT latest(k8s.nodeName) as 'Node Name' WHERE metricName = 'k8s.pod.createdAt' AND k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Node Name"
value: ""
- query: "FROM Metric SELECT max(k8s.container.restartCountDelta) AS 'Restart count' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-pending'"
expected_results:
- key: "Restart count"
value: nil
# END Failed Pod - Container Pending
# START Failed Pod - Container Creating
- query: "FROM Metric SELECT latest(if(k8s.pod.isReady = 1, 'True', 'False')) as 'Ready' WHERE k8s.namespaceName = 'nr-${SCENARIO_TAG}' AND k8s.podName = '${SCENARIO_TAG}-resources-container-creating'"
expected_results:
Expand Down