-
Notifications
You must be signed in to change notification settings - Fork 1
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
CRAYSAT-1937: Add the first functional test for SAT #648
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
haasken-hpe
requested review from
jacobsalmela,
mharding-hpe,
annapoorna-s-alt and
ethanholen-hpe
December 12, 2024 22:22
Test output:
And the detailed logs for this test show the individual Python test method being run via
|
mharding-hpe
approved these changes
Dec 12, 2024
mharding-hpe
force-pushed
the
CRAYSAT-1937-add-sat-version-test
branch
from
December 12, 2024 22:39
18e12f5
to
d1baa99
Compare
haasken-hpe
commented
Dec 13, 2024
Add the first functional test for the System Admin Toolkit (SAT). This is a proof of concept for future tests for SAT. This test simply executes the `sat --version` command on the NCN and verifies that the output matches the value in the file used to set the version. SAT tests are implemented in Python using the `unittest` standard library package. This provides an easy way to structure tests, add set up and tear down logic for each test, and run the tests from a script. The Python code for the SAT tests is all under a `sat_functional` subpackage, and individual subpackages and modules beneath that subpackage will implement tests for specific SAT functionality. Tests will be organized by the `sat` command they are testing. The `__main__.py` in the `sat_testing` module simply passes along the arguments, which should be a list of relative test paths, to the `unittest.TextTestRunner`, which then runs the tests. SAT tests are added in Gossfiles. Currently a single test file for SAT tests, `goss-sat-version.yaml`, is created. A test suite is created in the goss file `ncn-sat-functional-tests.yaml`. This test suite is limited to run on only `ncn-m001`. It will eventually include all SAT functional tests. Test Description: Downloaded the RPM built on Jenkins to drax. Extracted the RPM using `rpm2cpio $RPM_FILE | cpio -idvmu`. Modified the path to the Python virtual environment in the `test_sat_functional` script in the `bin` directory of the virtualenv to match the extraction path, set `GOSS_BASE` to the extracted Goss base directory, and then ran the Goss test file and test suite using `goss -g $GOSS_FILE validate`.
haasken-hpe
force-pushed
the
CRAYSAT-1937-add-sat-version-test
branch
from
December 13, 2024 15:49
d1baa99
to
539a1ea
Compare
haasken-hpe
requested review from
rajeshranganathan-hpe,
Srinivas-Anand-HPE and
Pankhuri-Rajesh
December 16, 2024 15:08
@rajeshranganathan-hpe, @Pankhuri-Rajesh, @Srinivas-Anand-HPE, I added you all for awareness per our meeting today. We'll keep you in the loop on further SAT automated testing PRs as well. |
jacobsalmela
approved these changes
Dec 16, 2024
ethanholen-hpe
approved these changes
Dec 16, 2024
annapoorna-s-alt
approved these changes
Dec 17, 2024
Pankhuri-Rajesh
approved these changes
Dec 17, 2024
/backport release/1.7 |
Backporting into branch release/1.7 was successful. New PR: #654 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary and Scope
Add the first functional test for the System Admin Toolkit (SAT). This is a proof of concept for future tests for SAT.
This test simply executes the
sat --version
command on the NCN and verifies that the output matches the value in the file used to set the version.SAT tests are implemented in Python using the
unittest
standard library package. This provides an easy way to structure tests, add set up and tear down logic for each test, and run the tests from a script. The Python code for the SAT tests is all under asat_functional
subpackage, and individual subpackages and modules beneath that subpackage will implement tests for specific SAT functionality. Tests will be organized by thesat
command they are testing.The
__main__.py
in thesat_testing
module simply passes along the arguments, which should be a list of relative test paths, to theunittest.TextTestRunner
, which then runs the tests.SAT tests are added in Gossfiles. Currently a single test file for SAT tests,
goss-sat-version.yaml
, is created. A test suite is created in the goss filencn-sat-functional-tests.yaml
. This test suite is limited to run on onlyncn-m001
. It will eventually include all SAT functional tests.Issues and Related PRs
Testing
Tested on:
drax
Test description:
Downloaded the RPM built on Jenkins to drax. Extracted the RPM using
rpm2cpio $RPM_FILE | cpio -idvmu
. Modified the path to the Python virtual environment in thetest_sat_functional
script in thebin
directory of the virtualenv to match the extraction path, setGOSS_BASE
to the extracted Goss base directory, and then ran the Goss test file and test suite usinggoss -g $GOSS_FILE validate
.Risks and Mitigations
Pretty low risk. It's possible the test could not work as I'm expecting in the vshasta jenkins jobs, but if that's the case, we can fix it. I'm not sure how to test beyond what I described above.
Pull Request Checklist