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

Update Makefile to support running specific unit and e2e tests (#1230) #1240

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nitishmalang
Copy link

updated the Makefile to allow running specific unit and e2e tests based on a test pattern. This helps reduce testing time by allowing run only the relevant tests for their changes.

Changes:

  • Added UNIT_TEST_PATTERN and E2E_TEST_PATTERN variables to filter tests.
  • Added test-unit-specific and test-e2e-specific targets to run specific tests.
  • Updated test-unit and test-e2e targets to support test filtering.

Usage Examples:

  • Run specific unit tests: make test-unit-specific UNIT_TEST_PATTERN="TestServices"
  • Run specific e2e tests: make test-e2e-specific E2E_TEST_PATTERN="TestServices"
  • Run all tests: make test

Fixes #1230.

@kmesh-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nlgwcy for approval. For more information see the Kubernetes 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

…-net#1230)

Signed-off-by: Nitish Malang <[email protected]>
Update Makefile to support running specific unit and e2e tests (kmesh-net#1230)

Signed-off-by: Nitish Malang <[email protected]>
@nitishmalang nitishmalang force-pushed the issue-1230-update-makefile branch from 4b9adaa to 7e59ab8 Compare February 13, 2025 21:20
Makefile Outdated
endif

# Run specific E2E tests
.PHONY: test-e2e-specific
test-e2e-specific:
Copy link
Member

Choose a reason for hiding this comment

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

Instead of adding target for each feature, we would prefer using parameters.

Copy link
Author

Choose a reason for hiding this comment

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

okay i am upadting it

@kmesh-bot kmesh-bot added size/S and removed size/M labels Feb 14, 2025
Copy link
Author

@nitishmalang nitishmalang left a comment

Choose a reason for hiding this comment

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

Removed -run Argument:

The -run argument was removed from the test-unit target because run-ut.sh does not support it.

Removed test-unit-specific and test-e2e-specific Targets:

Instead of adding new targets, we now use the UNIT_TEST_PATTERN and E2E_TEST_PATTERN variables to filter tests.

Simplified Test Targets:

The test-unit and test-e2e targets now simply call the respective scripts without additional filtering.

@nitishmalang nitishmalang force-pushed the issue-1230-update-makefile branch from d4729e7 to 7e59ab8 Compare February 14, 2025 19:44
./hack/run-ut.sh --local
endif

# Run E2E tests
.PHONY: test-e2e
test-e2e:
Copy link
Member

Choose a reason for hiding this comment

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

we already have make e2e, could you expand functionalities under it. Prefer not providing too many entries to run e2e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Makefile to run specific unit and e2e test
5 participants