Skip to content
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

Change subprocess/setup/shutdown sequence #71

Closed
aaaaalbert opened this issue Jul 14, 2016 · 2 comments
Closed

Change subprocess/setup/shutdown sequence #71

aaaaalbert opened this issue Jul 14, 2016 · 2 comments

Comments

@aaaaalbert
Copy link
Contributor

aaaaalbert commented Jul 14, 2016

As mentioned in #13, the unit test cases for a module may require a server/service subprocess to be spawned first, and may need specific setup and shutdown scripts too.

However, I find the sequencing weird, in that we do have nominal subprocess scripts that really perform a setup task [https://github.com/SeattleTestbed/nodemanager/blob/3134604ce95dac06a62f7bd042c5f41685c0c6ce/tests/ut_nm_subprocess.py#L6](such as initializing the test nodemanager's vesselinfo file).

Running setup -- subprocess -- test cases -- kill subprocess -- shutdown sounds more reasonable to me.

@aaaaalbert
Copy link
Contributor Author

Indeed, if I really wanted to run a script after "subprocess" is spawned / before it is stopped, I can just exploit the fact that test cases are run in alphabetical order. This would make the proposed sequence

Setup -- subprocess -- ut_MODULE_aaaaa..... (first in the list!) -- further test cases -- ut_MODULE_zzzzz..... (last in the list) -- kill subprocess -- shutdown.

aaaaalbert added a commit that referenced this issue Jul 19, 2016
Issue #69 suggested to replace `optparse` with `argparse`.
Issue #71 suggested to make this the module test sequence: setup --
  spawn subprocess -- run test cases -- tear down subprocess -- shutdown.
Issue #72 requested to allow for multiple files to be speficied for
  the `-f` command-line option.
aaaaalbert added a commit to aaaaalbert/nodemanager that referenced this issue Jul 20, 2016
This moves the initialization for the test nodemanager (using
`nminit.py`) from `ut_nm_subprocess` into `ut_nm_setup`. For this
to work, UTF must use the new sequencing of setup/subprocess/shutdown
and test cases, see SeattleTestbed/utf#71 for the issue description
and SeattleTestbed/utf#73 for the proposed fix.
@aaaaalbert
Copy link
Contributor Author

Fixed in #73, closing!

aaaaalbert added a commit to aaaaalbert/nodemanager that referenced this issue Feb 19, 2018
This moves the initialization for the test nodemanager (using
`nminit.py`) from `ut_nm_subprocess` into `ut_nm_setup`. For this
to work, UTF must use the new sequencing of setup/subprocess/shutdown
and test cases, see SeattleTestbed/utf#71 for the issue description
and SeattleTestbed/utf#73 for the proposed fix.
aaaaalbert added a commit to SeattleTestbed/nodemanager that referenced this issue Feb 19, 2018
This moves the initialization for the test nodemanager (using
`nminit.py`) from `ut_nm_subprocess` into `ut_nm_setup`. For this
to work, UTF must use the new sequencing of setup/subprocess/shutdown
and test cases, see SeattleTestbed/utf#71 for the issue description
and SeattleTestbed/utf#73 for the fix.
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

No branches or pull requests

1 participant