-
-
Notifications
You must be signed in to change notification settings - Fork 79
Create target test #1059
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
wesleybl
wants to merge
1
commit into
6.1
Choose a base branch
from
make_test
base: 6.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Create target test #1059
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -124,10 +124,24 @@ Run `make zope-start` to start the Zope instance. | |||||||||||||
|
|
||||||||||||||
| ### Run tests | ||||||||||||||
|
|
||||||||||||||
| This is not in the Makefile yet. We need to figure out how best to run the tests first. | ||||||||||||||
| A few sample commands that work for me: | ||||||||||||||
| Use the `make test` target to run unit tests for a package: | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| # Run all unit tests for a package (package is required) | ||||||||||||||
| make test package=plone.namedfile | ||||||||||||||
|
|
||||||||||||||
| # Run a specific test | ||||||||||||||
| make test package=plone.namedfile test=test_scaling | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| The target automatically detects the correct path for: | ||||||||||||||
| - Packages in development with modern layout (`src/package/src/`) | ||||||||||||||
| - Packages in development with legacy layout (`src/package/`) | ||||||||||||||
| - Packages installed in the virtual environment | ||||||||||||||
|
Comment on lines
+138
to
+140
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to capitalize a list item when it is not a sentence.
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| You can also run tests directly with `zope-testrunner`: | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| .venv/bin/zope-testrunner --test-path src/Products.CMFPlone -u | ||||||||||||||
| .venv/bin/zope-testrunner --test-path .venv/lib/python3.12/site-packages -s plone.memoize | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use generic shell syntax highlighter, don't use comments for instructions because they are low contrast in the rendered code block, and make it easier to copy-paste a single command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stevepiercy We need to specify somewhere that the
packageparameter is required.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wesleybl that's what line 135 does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 135 describes how to run only one test from a given package.
What I'm trying to say is that it's not possible to execute the command:
make testit's necessary to pass the package:
make test package=plone.namedfileSee: https://github.com/plone/buildout.coredev/pull/1059/files#diff-35b89ef65700ec4da068cc82250d658677a5aaabec8b91e21d0d3e69987c949fR130
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't understand what you mean. Line 135 mentions "the given package", and is followed by line 138, which has the
packageparameter.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wesleybl But the run-tests.sh script says it is supposed to be run using
make test, and that made me realize you are adding a newtesttarget even though there is already one: https://github.com/plone/buildout.coredev/blob/6.2/Makefile#L468There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, in version 6.1 it doesn't exist: https://github.com/plone/buildout.coredev/blob/6.1/Makefile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, it was added in #1020
It would be nice to have it for both 6.1 and 6.2, with the same implementation in both, and improve it to have a way to optionally run the tests for only one package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the target already accepts individual packages and tests:
https://github.com/plone/buildout.coredev/blob/6.2/Makefile#L468
I'll test it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked and actually the target in branch 6.2 doesn't support running only the tests from a specific package.