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

Testlib: provide a function to clean up all target-dir #1487

Open
castulo opened this issue Apr 20, 2020 · 2 comments
Open

Testlib: provide a function to clean up all target-dir #1487

castulo opened this issue Apr 20, 2020 · 2 comments
Labels

Comments

@castulo
Copy link
Contributor

castulo commented Apr 20, 2020

For some tests it make sense to use a global_setup to create the update content once, but we need a way to really clean up the target system between tests. So the proposal is to create a function that removes the target-dir entirely and recreates a new, empty one. We could then create the update content in a global_setup, and we could cleanup the target-dir during a teardown, making the global_setup more accessible for more tests.

@otaviobp
Copy link
Contributor

This won't solve the problem because any change in the test_env outside of target-dir will be propagated. I don't like the idea on having a global environment that sometimes is used and sometimes is not. The behavior of tests are already too different if we use test_setup() or global_setup() to create the test environment.

@castulo
Copy link
Contributor Author

castulo commented Apr 20, 2020

This won't solve the problem because any change in the test_env outside of target-dir will be propagated. I don't like the idea on having a global environment that sometimes is used and sometimes is not. The behavior of tests are already too different if we use test_setup() or global_setup() to create the test environment.

It will solve the problem for some cases. For example, if you create a test environment with some bundles, and then you have a bunch of tests that are validating adding bundles the you can use it, because you are not changing anything from the original update content, you are just changing the system where you are installing to. If in a test you need something that changes the update content but should not change for the other tests then yes, this won't work. But I think is responsibility of the test designer to know when they can or can't use this for a test. It seems pretty obvious to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants