From e0236dafe94391aa02730c8b322f833ba50b8f67 Mon Sep 17 00:00:00 2001 From: John Mertic Date: Tue, 19 Jan 2016 08:42:54 -0500 Subject: [PATCH 1/3] ODPI-75 - Write guidelines for creating tests Initial CONTRIBUTING.md file to provide guidelines for adding tests. --- CONTRIBUTING.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..0a9f393 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,48 @@ +# How to contribute to the ODPi + +Thank you for your interest in contributing to the ODPi! + +To start off, please ensure you have completed a Individual CLA for yourself. If you are contributing on behalf of an organization, you will also need to have the organization complete a Corporate CLA as well. See the links below for the process: + +[Contribute as an individual](https://identity.linuxfoundation.org/node/142/individual-signup) + +[Contribute as an organization](https://identity.linuxfoundation.org/node/142/organization-signup) + +## Ways to contribute + +There are two key areas you can contribute to the ODPi efforts. + +1. Provide feedback on the specs +2. Write tests to help validate an app or distro is compliant with the specs + +### Contributing tests + +The ODPi testing toolset is based on a fork of Apache BigTop 1.0.0, and leverages the existing BigTop smoke tests along with additional tests that verify ODPi compliance. + +#### Framework location + +Smoke tests are ran as gradle integration tests. All existing smoke tests (similar to future spec tests are located under `bigtop-tests/smoke-tests` directory. Tests could be executed from the top-level directory as the following command (in this case for hdfs smokes) +``` +./gradlew bigtop-tests:smoke-tests:hdfs:test -Psmoke.tests +``` +Optional `--info` could be added for higher verbosity. +If tests log level needs to be changes, it could be done in `bigtop-tests/smoke-tests/logger-test-config/src/main/resources/log4j.properties` file + +#### Tests location +Smoke tests for different components could be found under `bigtop-tests/smoke-tests` in the directories named after particular modules. Source code of a test suite might be co-located with the build directrory, or borrowed from another project. In this case, all *hdfs* tests source code is actually located in the maven project, yet executed as smokes. + +Source code directories are controlled by component's `build.gradle` file via `sourceSets` element. + +#### Tests +Tests could be written in Java, or Groovy. Tests can directly use JUnit APIs and will be correctly executed by the test runner. Optionally, tests could use facilities provided by iTest - Bigtop integration test framework. Among other things, iTest provide very conveninet org.apache.bigtop.itest.shell.Shell API, which adds bash scripting to the set of available languages. Shell class also has the capabilities to change the effective user owning exec'ed shell process. That requires passworless sudo to be configured. + +#### Examples of Spec tests +The examples of how to write spec tests could be found under https://github.com/c0s/bigtop/tree/spec-tests/bigtop-tests/spec-tests. + +Adding new tests is simple and is done via adding new test descriptions to `runtime/src/test/resources/testRuntimeSpecConf.groovy` file + +## Additional resources + +You can join the community conversation by subscribing to the mailing list below. + +https://lists.odpi.org/mailman3/lists/odpi-technical.lists.odpi.org/ From 2fb87d4bfb88af3b9f7b346a603a7033281b09a6 Mon Sep 17 00:00:00 2001 From: John Mertic Date: Wed, 20 Jan 2016 10:00:35 -0500 Subject: [PATCH 2/3] Updated per @cos feedback. --- CONTRIBUTING.md | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0a9f393..96212f0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,27 +19,39 @@ There are two key areas you can contribute to the ODPi efforts. The ODPi testing toolset is based on a fork of Apache BigTop 1.0.0, and leverages the existing BigTop smoke tests along with additional tests that verify ODPi compliance. -#### Framework location +Here's just a quick outline on the existing examples of the integration tests. These examples could be used to start writing spec tests. The following explains how smoke tests are developed right now. All smoke tests related activities should be carried on from odpi-master branch of odpi/bigtop repo. Same `repo/branch` should be used if you're standing up a cluster with Bigtop provisioner, e.g. `./gradlew -Pnum_instances=3 -Prun_smoke_tests=true docker-provisioner` -Smoke tests are ran as gradle integration tests. All existing smoke tests (similar to future spec tests are located under `bigtop-tests/smoke-tests` directory. Tests could be executed from the top-level directory as the following command (in this case for hdfs smokes) -``` -./gradlew bigtop-tests:smoke-tests:hdfs:test -Psmoke.tests -``` -Optional `--info` could be added for higher verbosity. -If tests log level needs to be changes, it could be done in `bigtop-tests/smoke-tests/logger-test-config/src/main/resources/log4j.properties` file +#### Framework location +Smoke tests are ran as gradle integration tests. All existing smoke tests (similar to future spec tests are located under `bigtop-tests/smoke-tests` directory. #### Tests location -Smoke tests for different components could be found under `bigtop-tests/smoke-tests` in the directories named after particular modules. Source code of a test suite might be co-located with the build directrory, or borrowed from another project. In this case, all *hdfs* tests source code is actually located in the maven project, yet executed as smokes. -Source code directories are controlled by component's `build.gradle` file via `sourceSets` element. +Smoke tests for different components could be found under `bigtop-tests/smoke-tests` in the directories named after particular modules. Source code of a test suite might be co-located with the `build` directrory, or borrowed from another project. In this case, all hdfs tests source code is actually located in the maven project, yet executed as smokes. +Source code directories are controlled by component's `build.gradle` file via sourceSets element. #### Tests + Tests could be written in Java, or Groovy. Tests can directly use JUnit APIs and will be correctly executed by the test runner. Optionally, tests could use facilities provided by iTest - Bigtop integration test framework. Among other things, iTest provide very conveninet org.apache.bigtop.itest.shell.Shell API, which adds bash scripting to the set of available languages. Shell class also has the capabilities to change the effective user owning exec'ed shell process. That requires passworless sudo to be configured. -#### Examples of Spec tests -The examples of how to write spec tests could be found under https://github.com/c0s/bigtop/tree/spec-tests/bigtop-tests/spec-tests. +#### Executing the smoke tests + +Tests could be executed from the top-level directory as the following command (in this case for hdfs smokes) +```` +./gradlew bigtop-tests:smoke-tests:hdfs:test -Psmoke.tests +```` +Optional `--info` could be added for higher verbosity. +If tests log level needs to be changes, it could be done in `bigtop-tests/smoke-tests/logger-test-config/src/main/resources/log4j.properties` file + +#### Examples of Spec tests -Adding new tests is simple and is done via adding new test descriptions to `runtime/src/test/resources/testRuntimeSpecConf.groovy` file +The examples of how to write spec tests could be found under +https://github.com/odpi/bigtop/tree/spec-tests/bigtop-tests/spec-tests +Adding new tests is simple and is done via adding new test descriptions to +`runtime/src/test/resources/testRuntimeSpecConf.groovy` file. For now spec-tests are under development and aren't available from the main odpi-master branch +To run spec tests you can follow the already familiar +```` +./gradlew bigtop-tests:spec-tests:runtime:test -Pspec.tests +```` ## Additional resources From 21607057124b3f2a002423fe5b7f9a6ab97e3b65 Mon Sep 17 00:00:00 2001 From: John Mertic Date: Fri, 22 Jan 2016 14:44:58 -0500 Subject: [PATCH 3/3] Changed to a simple file pointing to the wiki --- CONTRIBUTING.md | 61 ++----------------------------------------------- 1 file changed, 2 insertions(+), 59 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 96212f0..babe0fd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,60 +1,3 @@ -# How to contribute to the ODPi +You can learn about how to contribute in the Wiki -Thank you for your interest in contributing to the ODPi! - -To start off, please ensure you have completed a Individual CLA for yourself. If you are contributing on behalf of an organization, you will also need to have the organization complete a Corporate CLA as well. See the links below for the process: - -[Contribute as an individual](https://identity.linuxfoundation.org/node/142/individual-signup) - -[Contribute as an organization](https://identity.linuxfoundation.org/node/142/organization-signup) - -## Ways to contribute - -There are two key areas you can contribute to the ODPi efforts. - -1. Provide feedback on the specs -2. Write tests to help validate an app or distro is compliant with the specs - -### Contributing tests - -The ODPi testing toolset is based on a fork of Apache BigTop 1.0.0, and leverages the existing BigTop smoke tests along with additional tests that verify ODPi compliance. - -Here's just a quick outline on the existing examples of the integration tests. These examples could be used to start writing spec tests. The following explains how smoke tests are developed right now. All smoke tests related activities should be carried on from odpi-master branch of odpi/bigtop repo. Same `repo/branch` should be used if you're standing up a cluster with Bigtop provisioner, e.g. `./gradlew -Pnum_instances=3 -Prun_smoke_tests=true docker-provisioner` - -#### Framework location -Smoke tests are ran as gradle integration tests. All existing smoke tests (similar to future spec tests are located under `bigtop-tests/smoke-tests` directory. - -#### Tests location - -Smoke tests for different components could be found under `bigtop-tests/smoke-tests` in the directories named after particular modules. Source code of a test suite might be co-located with the `build` directrory, or borrowed from another project. In this case, all hdfs tests source code is actually located in the maven project, yet executed as smokes. -Source code directories are controlled by component's `build.gradle` file via sourceSets element. - -#### Tests - -Tests could be written in Java, or Groovy. Tests can directly use JUnit APIs and will be correctly executed by the test runner. Optionally, tests could use facilities provided by iTest - Bigtop integration test framework. Among other things, iTest provide very conveninet org.apache.bigtop.itest.shell.Shell API, which adds bash scripting to the set of available languages. Shell class also has the capabilities to change the effective user owning exec'ed shell process. That requires passworless sudo to be configured. - -#### Executing the smoke tests - -Tests could be executed from the top-level directory as the following command (in this case for hdfs smokes) -```` -./gradlew bigtop-tests:smoke-tests:hdfs:test -Psmoke.tests -```` -Optional `--info` could be added for higher verbosity. -If tests log level needs to be changes, it could be done in `bigtop-tests/smoke-tests/logger-test-config/src/main/resources/log4j.properties` file - -#### Examples of Spec tests - -The examples of how to write spec tests could be found under -https://github.com/odpi/bigtop/tree/spec-tests/bigtop-tests/spec-tests -Adding new tests is simple and is done via adding new test descriptions to -`runtime/src/test/resources/testRuntimeSpecConf.groovy` file. For now spec-tests are under development and aren't available from the main odpi-master branch -To run spec tests you can follow the already familiar -```` -./gradlew bigtop-tests:spec-tests:runtime:test -Pspec.tests -```` - -## Additional resources - -You can join the community conversation by subscribing to the mailing list below. - -https://lists.odpi.org/mailman3/lists/odpi-technical.lists.odpi.org/ +https://github.com/odpi/specs/wiki/Contributing