Skip to content

Demo of LISAv3 using Pytest#1044

Closed
andyleejordan wants to merge 61 commits into
masterfrom
andschwa/pytest
Closed

Demo of LISAv3 using Pytest#1044
andyleejordan wants to merge 61 commits into
masterfrom
andschwa/pytest

Conversation

@andyleejordan
Copy link
Copy Markdown
Member

This is a proposed (and working) alternative design leveraging Pytest.

This is a _working_ test.
Extend Fabric’s Connection class with a new (and simple) command “cat”
which return the value of a remote file as a string.

Setup a Config for the Connection when creating it that echoes every
command, disables the stdin forwarding (since we’re running under
Pytest), and fixes the PATH since the remote commands don’t run under a
login shell.
@andyleejordan andyleejordan added the 🆕 LISAv3 Incubation work for the next version of LISA label Oct 12, 2020
This could be extended to instead deploy a host of the specified distro.
Most likely we’ll want a command-line parameter that the fixture uses to
create a Node with the given requirements, and then tests will be
skipped if their requirements aren’t met.

Further more, the mark here is very simple. It can instead take keyword
arguments, which would map to our metadata.
As supplying types for these would be supremely annoying.
Comment thread pytest/README.md
Comment thread pytest/README.md
@andyleejordan andyleejordan force-pushed the andschwa/pytest branch 2 times, most recently from eedfd94 to 5732fa9 Compare October 18, 2020 01:26
@andyleejordan andyleejordan force-pushed the andschwa/pytest branch 2 times, most recently from eb0ddab to a9e4aff Compare October 18, 2020 01:39
Tenacity’s `stop_after_delay` seems to get confused underneath pytest,
applying the delay as a total to all code using it, meaning the last
test `get_boot_diagnostics` started always failing due to being
canceled. There appears to be a similar issue (though fixed) in the
library for async functions, where the state on their `RetryState`
object doesn’t get reset properly.
This reverts commit a9e4aff.

The plugin is incompatible with class fixtures, so when the last test
in a test class fails, the fixture is torn down (in this case, deleting
the node) before the test is retried, which doesn’t work for us.
Note that `warn=True` causes timeouts to be ignored. On some images, the
invoked program (it’s not even a shell) just hangs waiting for manual
input. So we set a proper timeout.
They can serve completely different purposes. In this case, re-running
the whole test and reporting it as a second test run.
@andyleejordan
Copy link
Copy Markdown
Member Author

Replacing with a real PR and CI and such in #1065.

@andyleejordan andyleejordan deleted the andschwa/pytest branch October 21, 2020 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 LISAv3 Incubation work for the next version of LISA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants