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

e2e: Fail faster if checkup has failed #43

Merged
merged 1 commit into from
Dec 3, 2023

Conversation

RamLavi
Copy link
Collaborator

@RamLavi RamLavi commented Dec 3, 2023

Currently the e2e test waits for a JobComplete status, so if the checkup job fails then the test hangs until the timeout.
Check for JobFailed condition and fail with an informative error fail.

@RamLavi
Copy link
Collaborator Author

RamLavi commented Dec 3, 2023

example for failure:

make e2e-test
mkdir -p /home/ralavi/go/src/github.com/kiagnose/kubevirt-realtime-checkup/_go-cache
podman run --rm \
	-v /home/ralavi/go/src/github.com/kiagnose/kubevirt-realtime-checkup:/go/src/github.com/kiagnose/kubevirt-realtime-checkup:Z \
	-v /home/ralavi/go/src/github.com/kiagnose/kubevirt-realtime-checkup/_go-cache:/root/.cache/go-build:Z \
	-v /home/ralavi/.kube/sno03-cnvqe2-rdu2:/root/.kube:Z,ro \
	--workdir /go/src/github.com/kiagnose/kubevirt-realtime-checkup \
	-e KUBECONFIG=/root/.kube/kubeconfig \
	-e TEST_NAMESPACE=realtime-checkup-1 \
	-e TEST_CHECKUP_IMAGE=quay.io/ramlavi/kubevirt-realtime-checkup:devel \
	-e VM_UNDER_TEST_CONTAINER_DISK_IMAGE=quay.io/kiagnose/kubevirt-realtime-checkup-vm:main \
	docker.io/library/golang:1.19.4-bullseye \
	go test -v ./tests/...
=== RUN   TestTests
Running Suite: Tests Suite - /go/src/github.com/kiagnose/kubevirt-realtime-checkup/tests
========================================================================================
Random Seed: 1701606425

Will run 1 of 1 specs
------------------------------
• [FAILED] [13.413 seconds]
Checkup execution [It] should complete successfully
/go/src/github.com/kiagnose/kubevirt-realtime-checkup/tests/checkup_test.go:80

  [FAILED] checkup failed: {
  	"spec.param.oslatDuration": "10m",
  	"spec.param.oslatLatencyThresholdMicroSeconds": "45",
  	"spec.param.vmUnderTestContainerDiskImage": "quay.io/kiagnose/kubevirt-realtime-checkup-vm:main",
  	"spec.param.vmUnderTestTargetNodeName": "",
  	"spec.timeout": "15m",
  	"status.completionTimestamp": "2023-12-03T12:27:13Z",
  	"status.failureReason": "admission webhook \"virtualmachineinstances-create-validator.kubevirt.io\" denied the request: spec.domain.memory.hugepages must be requested when NUMA topology strategy is set in spec.domain.cpu.numa.guestMappingPassthrough",
  	"status.startTimestamp": "2023-12-03T12:27:13Z",
  	"status.succeeded": "false"
  }
  In [It] at: /go/src/github.com/kiagnose/kubevirt-realtime-checkup/tests/checkup_test.go:90 @ 12/03/23 12:27:17.556
------------------------------

Summarizing 1 Failure:
  [FAIL] Checkup execution [It] should complete successfully
  /go/src/github.com/kiagnose/kubevirt-realtime-checkup/tests/checkup_test.go:90

Ran 1 of 1 Specs in 13.414 seconds
FAIL! -- 0 Passed | 1 Failed | 0 Pending | 0 Skipped
--- FAIL: TestTests (13.42s)
FAIL
FAIL	github.com/kiagnose/kubevirt-realtime-checkup/tests	13.423s
FAIL
make: *** [Makefile:67: e2e-test] Error 1

@RamLavi RamLavi requested a review from orelmisan December 3, 2023 13:31
Currently the e2e test waits for a JobComplete status, so if the checkup
job fails then the test hangs until the timeout.
Check for JobFailed condition and fail with an informative error fail.

Signed-off-by: Ram Lavi <ralavi@redhat.com>
@RamLavi
Copy link
Collaborator Author

RamLavi commented Dec 3, 2023

PR passes e2e test on CNV4.14 cluster

make e2e-test
mkdir -p /home/ralavi/go/src/github.com/kiagnose/kubevirt-realtime-checkup/_go-cache
podman run --rm \
	-v /home/ralavi/go/src/github.com/kiagnose/kubevirt-realtime-checkup:/go/src/github.com/kiagnose/kubevirt-realtime-checkup:Z \
	-v /home/ralavi/go/src/github.com/kiagnose/kubevirt-realtime-checkup/_go-cache:/root/.cache/go-build:Z \
	-v /home/ralavi/.kube/sno03-cnvqe2-rdu2:/root/.kube:Z,ro \
	--workdir /go/src/github.com/kiagnose/kubevirt-realtime-checkup \
	-e KUBECONFIG=/root/.kube/kubeconfig \
	-e TEST_NAMESPACE=realtime-checkup-1 \
	-e TEST_CHECKUP_IMAGE=quay.io/ramlavi/kubevirt-realtime-checkup:devel \
	-e VM_UNDER_TEST_CONTAINER_DISK_IMAGE=quay.io/kiagnose/kubevirt-realtime-checkup-vm:main \
	docker.io/library/golang:1.19.4-bullseye \
	go test -v ./tests/...
=== RUN   TestTests
Running Suite: Tests Suite - /go/src/github.com/kiagnose/kubevirt-realtime-checkup/tests
========================================================================================
Random Seed: 1701610513

Will run 1 of 1 specs
•

Ran 1 of 1 Specs in 91.373 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestTests (91.37s)
PASS
ok  	github.com/kiagnose/kubevirt-realtime-checkup/tests	91.391s

@RamLavi RamLavi merged commit 464d8f4 into kiagnose:main Dec 3, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants