-
Notifications
You must be signed in to change notification settings - Fork 232
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
Documentation added for testing #1281
Conversation
Signed-off-by: Raza Jafri <rjafri@nvidia.com>
0b01d85
to
a90286e
Compare
@sameerz PTAL |
Co-authored-by: Jason Lowe <jlowe@nvidia.com>
Addressed review comments
minor change to the example and fixed a broken link
build |
1 similar comment
build |
build |
docs/dev/testing.md
Outdated
- To run test ParquetWriterSuite in package com.nvidia.spark.rapids, issue `mvn test -DwildcardSuites="com.nvidia.spark.rapids.ParquetWriterSuite"` | ||
|
||
|
||
#### Integration 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.
so there is already documentation in integration_tests.md do we really need this in both places? or just have a link and put the details in that doc
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 would prefer to have us link to it. There is also documentation about unit tests
https://github.com/NVIDIA/spark-rapids/blob/branch-0.3/docs/testing.md
Not sure why we are not linking to that primarily and updating it as needed.
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 will link to the testing doc and update if needed. I honestly wasn't aware we have a document already, thanks for bringing it up
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'm still confused, why do we have so many different docs for testing. I realize you linked them but now there is info in testing.md and integrationtest.md . We added information here on running but I need to go to integration tests readme.md to know what i need to install to add it. why don't we put all information in the integration test readme and test readme and just have small description and point to those? Maybe i'm missing something @revans2 @jlowe opinions?
docs/dev/testing.md
Outdated
better insight into what is needed as we constantly keep working on to improve and expand the plugin-support. | ||
|
||
The tests are written python and run with pytest and the script honors pytest parameters. Some handy flags are: | ||
- `-k` <pytest-file-name>. This will run all the tests in that test file. |
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 guess I haven't tried this, usually I specify the path to the test file to run all tests in a file. I supposed both works? or is this specific to the run_pyspark_from_build.sh script? I have been doing spark-submit way.
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.
-k
does a test search for the name of the test. This includes the file name and the extensions for specific parameters. I prefer -k because I can do things like -k Decimal
and I will typically end up running all of the tests that touch the decimal type either as a parameter or something else.
But it would be good to document both ways.
docs/dev/testing.md
Outdated
- `-k` <pytest-file-name>. This will run all the tests in that test file. | ||
- `-k` <test-name>. This will also run an individual test. | ||
- `-s` Doesn't capture the output and instead prints to the screen. | ||
- `-v` increase verbosity of the 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.
perhaps add the debug tmp path option that save the output
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.
are you referring to --debug
? This option doesn't accept path. Are you referring to some other option?
docs/dev/testing.md
Outdated
@@ -0,0 +1,44 @@ | |||
### Testing your code | |||
There are two types of tests in this project. Unit tests that are written in Scala, and integration tests that are written in Python. |
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.
We actually have integration tests in both Scala and python.
docs/dev/testing.md
Outdated
- To run test ParquetWriterSuite in package com.nvidia.spark.rapids, issue `mvn test -DwildcardSuites="com.nvidia.spark.rapids.ParquetWriterSuite"` | ||
|
||
|
||
#### Integration 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.
I would prefer to have us link to it. There is also documentation about unit tests
https://github.com/NVIDIA/spark-rapids/blob/branch-0.3/docs/testing.md
Not sure why we are not linking to that primarily and updating it as needed.
docs/dev/testing.md
Outdated
better insight into what is needed as we constantly keep working on to improve and expand the plugin-support. | ||
|
||
The tests are written python and run with pytest and the script honors pytest parameters. Some handy flags are: | ||
- `-k` <pytest-file-name>. This will run all the tests in that test file. |
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.
-k
does a test search for the name of the test. This includes the file name and the extensions for specific parameters. I prefer -k because I can do things like -k Decimal
and I will typically end up running all of the tests that touch the decimal type either as a parameter or something else.
But it would be good to document both ways.
build |
build |
@tgravescs @revans2 I have addressed your concerns PTAL |
docs/testing.md
Outdated
@@ -39,20 +39,54 @@ They generally follow TPCH but are not guaranteed to be the same. | |||
|
|||
## Unit tests | |||
|
|||
Unit tests exist in the tests directory. This is unconventional and is done so we can run the tests | |||
on the final shaded version of the plugin. It also helps with how we collect code coverage. | |||
Unit tests exist in the [here](tests) directory. This is unconventional and is done so we can run |
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.
"unit tests exist in the here directory" is not very readable. Also not sure why you are linking to. There is no tests directory or file under docs that this can or should link to.
docs/testing.md
Outdated
Unit tests exist in the [here](tests) directory. This is unconventional and is done so we can run | ||
the tests on the final shaded version of the plugin. It also helps with how we collect code coverage. | ||
|
||
in order to run the unit-tests follow these steps |
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.
Please capitalize sentences.
docs/testing.md
Outdated
|
||
in order to run the unit-tests follow these steps | ||
1. issue the maven command to run the tests with `mvn test`. this will run all the tests | ||
2. to run individual tests append `-dwildcardsuites=<comma separated list of wildcard suite names to execute>` to the above 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.
These are not steps. They are options and I don't think we need a list to express them.
docs/testing.md
Outdated
1. issue the maven command to run the tests with `mvn test`. this will run all the tests | ||
2. to run individual tests append `-dwildcardsuites=<comma separated list of wildcard suite names to execute>` to the above command | ||
|
||
for more information about using scalatest with maven please refere [here](https://www.scalatest.org/user_guide/using_the_scalatest_maven_plugin) |
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'm not known for my spelling but I don't think refer has an "e" at the end
docs/testing.md
Outdated
There are two frameworks used for testing. One is based off of pytest and pyspark in the | ||
`src/main/python` directory. These tests will run as a part of the maven build if you have the environment | ||
variable `SPARK_HOME` set. | ||
Integration tests are stored in the [integration_tests](integration_tests) 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.
This is not in the right directory for this link to work. Please change it back to the README or at least ../integration_tests
docs/testing.md
Outdated
@@ -117,3 +151,12 @@ Next you can start to run the tests. | |||
durations.run(new com.nvidia.spark.rapids.JoinsSuite) | |||
... | |||
``` | |||
|
|||
For more details on Integration tests options please refer to integration-test [doc](integration-tests/README.md) |
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.
Need to test out the links I don't think this works.
@revans2 better now? The links were all copied from where I added this section originally in the CONTRIBUTING.md. Thanks for reviewing |
build |
docs/testing.md
Outdated
|
||
In order to run the unit-tests issue the maven command to run the tests i.e. `mvn test`. | ||
|
||
To run individual tests append `-DwildcardSuites=<comma separated list of wildcard suite names to execute>` to the above 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.
does this work for both scala and java tests? I know the java ones are different in spark
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.
wildcardSuites only applies to scalatest. Java tests need to be filtered via surefire's approach which is -Dtest=...
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.
right so we have a java test right - TestHashedPriorityQueue.java? so adding how to run it would be useful and specifying here this works for scala 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.
I guess this text is old new one mentions scala tests
docs/dev/testing.md
Outdated
- To run test ParquetWriterSuite in package com.nvidia.spark.rapids, issue `mvn test -DwildcardSuites="com.nvidia.spark.rapids.ParquetWriterSuite"` | ||
|
||
|
||
#### Integration 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.
I'm still confused, why do we have so many different docs for testing. I realize you linked them but now there is info in testing.md and integrationtest.md . We added information here on running but I need to go to integration tests readme.md to know what i need to install to add it. why don't we put all information in the integration test readme and test readme and just have small description and point to those? Maybe i'm missing something @revans2 @jlowe opinions?
docs/testing.md
Outdated
Unit tests exist in the [tests](../tests) directory. This is unconventional and is done so we can | ||
run the tests on the final shaded version of the plugin. It also helps with how we collect code coverage. | ||
|
||
In order to run the unit-tests issue the maven command to run the tests i.e. `mvn 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.
In order to run the unit-tests issue the maven command to run the tests i.e. `mvn test`. | |
Use Maven to run the unit tests via `mvn test`. |
docs/testing.md
Outdated
|
||
In order to run the unit-tests issue the maven command to run the tests i.e. `mvn test`. | ||
|
||
To run individual tests append `-DwildcardSuites=<comma separated list of wildcard suite names to execute>` to the above 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.
wildcardSuites only applies to scalatest. Java tests need to be filtered via surefire's approach which is -Dtest=...
docs/testing.md
Outdated
apache spark specific configurations can be passed in by setting environment-variable spark_conf | ||
|
||
Examples: | ||
-To run tests against Apache Spark 3.1.0, |
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.
This says it will run tests against Spark 3.1.0 but only runs one test. Either fix the description or fix the example.
I'm all for not repeating information across the various docs and instead linking. I agree we should keep unit test info to the unit test docs and integration test info to the integration test docs. Each doc can reference the other for more information on running the unit tests vs. integration tests. |
I'm not a big fan of pointing things from the docs directory outside of it, simply because the docs directory gets moved around when it becomes the github pages site. But because this is docs for developers I think @jlowe is right and we should have it all in the README for the various directories with links to them, so long as we are careful to make sure that the links work on the github pages site and in markdown. |
Sorry about the back and forth. I have incorporated all the suggestions I think. Please check if this looks good. I have also added a section on the project README.md for tests and linked it to tests/README.md. Let me know if that looks good |
build |
build |
@revans2 @tgravescs do you have any other suggestions or does this look OK to go in? |
Co-authored-by: Jason Lowe <jlowe@nvidia.com>
Co-authored-by: Jason Lowe <jlowe@nvidia.com>
Co-authored-by: Jason Lowe <jlowe@nvidia.com>
Co-authored-by: Jason Lowe <jlowe@nvidia.com>
Co-authored-by: Jason Lowe <jlowe@nvidia.com>
Co-authored-by: Jason Lowe <jlowe@nvidia.com>
build |
@jlowe thanks for the suggestions. They have all been applied. Please take another look |
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.
This looks OK to me, but @revans2 and @tgravescs should comment before merging.
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.
overall is fine, I think we have one java unit test that we could say how to run individually but not a big deal
Thanks, @tgravescs I have created a follow-on #1345 |
* documentation added for testing Signed-off-by: Raza Jafri <rjafri@nvidia.com> * Capitalize word Co-authored-by: Jason Lowe <jlowe@nvidia.com> * Update CONTRIBUTING.md Addressed review comments * Update CONTRIBUTING.md minor change to the example and fixed a broken link * created a separate document for testing * addressed review comments * minor fix * fixed broken links and capitalization * addressed review comments * fix broken link * exclude README.md from rat * Update CONTRIBUTING.md Co-authored-by: Jason Lowe <jlowe@nvidia.com> * Update CONTRIBUTING.md Co-authored-by: Jason Lowe <jlowe@nvidia.com> * Update tests/README.md Co-authored-by: Jason Lowe <jlowe@nvidia.com> * Update tests/README.md Co-authored-by: Jason Lowe <jlowe@nvidia.com> * Update tests/README.md Co-authored-by: Jason Lowe <jlowe@nvidia.com> * Update tests/README.md Co-authored-by: Jason Lowe <jlowe@nvidia.com> Co-authored-by: Raza Jafri <rjafri@nvidia.com> Co-authored-by: Jason Lowe <jlowe@nvidia.com>
* documentation added for testing Signed-off-by: Raza Jafri <rjafri@nvidia.com> * Capitalize word Co-authored-by: Jason Lowe <jlowe@nvidia.com> * Update CONTRIBUTING.md Addressed review comments * Update CONTRIBUTING.md minor change to the example and fixed a broken link * created a separate document for testing * addressed review comments * minor fix * fixed broken links and capitalization * addressed review comments * fix broken link * exclude README.md from rat * Update CONTRIBUTING.md Co-authored-by: Jason Lowe <jlowe@nvidia.com> * Update CONTRIBUTING.md Co-authored-by: Jason Lowe <jlowe@nvidia.com> * Update tests/README.md Co-authored-by: Jason Lowe <jlowe@nvidia.com> * Update tests/README.md Co-authored-by: Jason Lowe <jlowe@nvidia.com> * Update tests/README.md Co-authored-by: Jason Lowe <jlowe@nvidia.com> * Update tests/README.md Co-authored-by: Jason Lowe <jlowe@nvidia.com> Co-authored-by: Raza Jafri <rjafri@nvidia.com> Co-authored-by: Jason Lowe <jlowe@nvidia.com>
Signed-off-by: Tim Liu <timl@nvidia.com>
This PR starts the process of improving our documentation for running integration and unit-tests
This addresses #814