-
Notifications
You must be signed in to change notification settings - Fork 123
[BEAM-3985] Document Gradle commands for testing and linting. #412
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
Conversation
|
R: @melap |
| To Check for lint errors locally, run the following command. | ||
|
|
||
| $ mvn clean verify -pl sdks/python | ||
| $ ../../gradlew lint |
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.
Make it clear that ../.. is here because we assume it is being run from the sdks/python directory.
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.
done.
|
Dead link error is @melap does it need to be fixed in this PR? |
|
retest this please |
|
So I didn't realize you were working on this. I made some overlapping changes in my PR #414, so one of us will probably need to merge the changes. |
src/contribute/contribution-guide.md
Outdated
| $ mvn clean verify | ||
| Run this command to test for lint errors. | ||
|
|
||
| $ ./gradlew lint |
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 don't think this needs to be mentioned here since the lint task only lints the Python code right now.
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.
Removed.
src/contribute/contribution-guide.md
Outdated
| git repository. | ||
|
|
||
| For contributions to the Java code, run unit tests locally via Maven. | ||
| $ ./gradlew test |
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.
Perhaps adding some instructions for calling unit tests on certain languages may be useful. This is slightly different than the precommit info down below because it is only unit tests.
Examples:
$ ./gradlew sdks:java:test
$ ./gradlew sdks:python:test
$ ./gradlew sdks:go:test
Also may be worth using the "check" task instead of "test". According to the gradle docs:
It is common for all verification tasks, including tests and linting, to be executed using the check task. (Source)
I don't know if Beam is doing this at the moment, but I feel like this area of the code should mention using check for more intense checks (i.e. for replacing mvn verify), while test is better for basic unit tests.
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.
Replaced with check, which includes lint (on some SDKs).
I replaced the precommit tasks below with *:check, for language SDKs that had them (I don't know if there's a Java check task for all parts of the Java SDK).
|
@udim You're probably right about the |
src/contribute/contribution-guide.md
Outdated
|
|
||
| You can also limit tests to certain language SDKs. | ||
|
|
||
| $ ./gradlew javaPreCommit |
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.
These precommits typically need more like a GCP account since they run wordcount against Dataflow.
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.
Okay, so what is the suggested gradle task to run java tests?
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.
Removed javaPreCommit
9a6abc5 to
93de5e8
Compare
Also update Python SDK instructions and reorganize them a bit.
|
Rebased. |
|
Thank you @udim. LGTM. |
|
@asfgit merge |
|
Error: Adding files from repository preparation failed. Please try again. |
|
@melap I see the merged commit in the repository (https://gitbox.apache.org/repos/asf?p=beam-site.git;a=log;h=refs/heads/asf-site). Do we need to take action to resolve the latest error message from the merge bot? |
|
good question -- it looks like the changes are up on the website too, so I am unsure what that error means. @jasonkuster or @alanmyrvold should we just ignore this error? |
Also fixes outdated references to lint_py2 and lint_py3.