Skip to content

[BEAM-3985] Document Gradle commands for testing and linting.#412

Merged
asfgit merged 1 commit into
apache:asf-sitefrom
udim:asf-site
Apr 12, 2018
Merged

[BEAM-3985] Document Gradle commands for testing and linting.#412
asfgit merged 1 commit into
apache:asf-sitefrom
udim:asf-site

Conversation

@udim

@udim udim commented Apr 6, 2018

Copy link
Copy Markdown
Member

Also fixes outdated references to lint_py2 and lint_py3.

@udim

udim commented Apr 6, 2018

Copy link
Copy Markdown
Member Author

R: @melap

To Check for lint errors locally, run the following command.

$ mvn clean verify -pl sdks/python
$ ../../gradlew lint

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done.

@aaltay

aaltay commented Apr 6, 2018

Copy link
Copy Markdown
Member

Dead link error is

- ./.testcontent/contribute/work-in-progress/index.html
  *  External link https://github.com/apache/beam/tree/go-sdk failed: 404 No error

@melap does it need to be fixed in this PR?

@melap

melap commented Apr 6, 2018

Copy link
Copy Markdown

retest this please

@youngoli

youngoli commented Apr 6, 2018

Copy link
Copy Markdown

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.

@udim

udim commented Apr 6, 2018

Copy link
Copy Markdown
Member Author

Sorry for not coordinating with you @youngoli, let's merge #414 first and I'll deal with the conflicts in mine.
BTW, what do you think of my suggestions for running tests and lint? I don't believe that running clean first is necessary, but I might be wrong.

Comment thread src/contribute/contribution-guide.md Outdated
$ mvn clean verify
Run this command to test for lint errors.

$ ./gradlew lint

Copy link
Copy Markdown

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed.

Comment thread src/contribute/contribution-guide.md Outdated
git repository.

For contributions to the Java code, run unit tests locally via Maven.
$ ./gradlew test

Copy link
Copy Markdown

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.

Copy link
Copy Markdown
Member Author

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).

@youngoli

youngoli commented Apr 6, 2018

Copy link
Copy Markdown

@udim You're probably right about the ./gradlew clean being unnecessary. I only had it there because it was mentioned in the original code with mvn clean verify.

Comment thread src/contribute/contribution-guide.md Outdated

You can also limit tests to certain language SDKs.

$ ./gradlew javaPreCommit

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member Author

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed javaPreCommit

@udim udim force-pushed the asf-site branch 2 times, most recently from 9a6abc5 to 93de5e8 Compare April 10, 2018 22:10
@aaltay

aaltay commented Apr 12, 2018

Copy link
Copy Markdown
Member

@udim Could you rebase and update this PR. Is this still relevant after #414?

Also update Python SDK instructions and reorganize them a bit.
@udim

udim commented Apr 12, 2018

Copy link
Copy Markdown
Member Author

Rebased.

@aaltay

aaltay commented Apr 12, 2018

Copy link
Copy Markdown
Member

Thank you @udim. LGTM.

@aaltay

aaltay commented Apr 12, 2018

Copy link
Copy Markdown
Member

@asfgit merge

asfgit pushed a commit that referenced this pull request Apr 12, 2018
@asfgit asfgit merged commit 29600fd into apache:asf-site Apr 12, 2018
@asfgit

asfgit commented Apr 12, 2018

Copy link
Copy Markdown

Error: Adding files from repository preparation failed. Please try again.

@aaltay

aaltay commented Apr 12, 2018

Copy link
Copy Markdown
Member

@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?

@melap

melap commented Apr 12, 2018

Copy link
Copy Markdown

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?

robertwb pushed a commit to robertwb/incubator-beam that referenced this pull request Jun 5, 2018
robertwb pushed a commit to robertwb/incubator-beam that referenced this pull request Jun 5, 2018
melap pushed a commit to apache/beam that referenced this pull request Jun 20, 2018
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.

6 participants