Skip to content

test: allow e2e tests to output junit report #2334

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maxcao13
Copy link
Contributor

Fixes #N/A

Description
Adds the ability to specify ARTIFACT_DIR in the Makefile which allows e2e tests to output a junit_report.xml file to it, if ARTIFACT_DIR is specified.

How was this change tested?
Running

ARTIFACT_DIR=some_dir make e2etests

on a kind cluster with all prerequisite steps (make install-kwok, make apply-with-kind, etc.).

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 25, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: maxcao13
Once this PR has been reviewed and has the lgtm label, please assign jmdeal for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 25, 2025
@@ -41,12 +41,14 @@ apply-with-kind: verify build-with-kind ## Deploy the kwok controller from the c
--set-string controller.env[0].name=ENABLE_PROFILING \
--set-string controller.env[0].value=true

JUNIT_REPORT := $(if $(ARTIFACT_DIR), --ginkgo.junit-report="$(ARTIFACT_DIR)/junit_report.xml")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this conditional? Only get the report when we have an ENV

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review.

Sorry if the code is not clear, or I am misinterpreting you but I think the line is already conditional?

The $(if ...) function sets the JUNIT_REPORT variable to the --ginkgo.junit-report flag only when the ARTIFACT_DIR environment variable is defined, otherwise it will just be an empty string and not affect the full go test command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants