opensearch-project / opensearch-build-libraries

Apache License 2.0
7 stars 25 forks source link

[PROPOSAL] Add tests for groovy scripts in vars folder #508

Closed pranav767 closed 1 month ago

pranav767 commented 1 month ago

Is your feature request related to a problem? Please describe

Currently from build.gradle we can see that the tests are only covering 'src/jenkins', 'src/gradlecheck' . I can see multiple groovy scripts inside vars directory which are not yet covered in the unit tests. Correct me if I am wrong, but I feel this scripts are as important as the others in the src directory. I do see there are tests written in jobs directory,but these seem to be more like integration/regression tests than unit tests

Describe the solution you'd like

We could start writing tests for each groovy files in vars directory, and add the sourcefile in build.gradle , while maintaining the record of which groovy scripts are covered and which needs to be covered yet.

Describe alternatives you've considered

No response

Additional context

No response

gaiksaya commented 1 month ago

Hi @pranav767

Thank you for opening the issue. We are using JenkinsPipelineUnit for testing the libraries in vars folder. See the developer guide for more details. https://github.com/opensearch-project/opensearch-build-libraries/blob/main/DEVELOPER_GUIDE.md#run-tests

Are you suggesting anything else other than these? Please feel to contribute as well so that we get more idea.

Thanks!

pranav767 commented 1 month ago

Hey @gaiksaya ,thank you for your response Apologies, after reading https://github.com/opensearch-project/opensearch-build-libraries/blob/main/DEVELOPER_GUIDE.md#run-tests I could see that tests are well written 👏