-
Notifications
You must be signed in to change notification settings - Fork 276
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
Design test strategy #1579
Comments
It probably makes sense to split each test area into a separate issue where the scope, actual tests and proposed test architecture can be defined. |
Thanks for writing this down. Edited the list to add target paths to table testing section |
I'm looking at legacy updater tests currently: I'll try to document the actual tests they contain (at least the ones that still apply) and take notes on what useful approaches they might use. |
After some iterations over the potential test areas and topics, we've narrowed down several bigger ones that we want to start the testing with and keep refining and improving further. A preview of the next steps:
|
I tried this a bit and it's fairly easy to add things like this: # assert that only downloads during refresh are root and timestamp
with self.sim.assert_metadata_fetches({'root': 1, 'timestamp': 1}):
updater.refresh() it's ugly enough that we likely don't want to do that in every test -- but we could for example write one slightly more complex test with asserts like this to ensure we download exactly what we expect to download. I think your mock wrap suggestion will be good for ensuring we only read/write the local files we expect to read/write -- similar approach of only testing it in a specific test (and not in every test) probably works. |
I have some ideas here (and have also read through all of the relevant legacy tests recently). I'll try to have a go at this within the next days if no-one else beats me to it |
A new set of tests for your list: Expiry tests
Some of these may already be tested by TrustedMetadataSet but I tried to list every case... |
In pr #1605 we are adding a new configuration option for the RepositorySimulator called |
Notes after playing with code a little:
with mock.patch.object(
simulator, "_fetch_metadata", wraps=simulator._fetch_metadata
) as wrapped_fetch_metadata:
wrapped_fetch_metadata.assert_called_with(...) "wraps" will pass the call through to the wrapped object (returning the real result). |
The main categories of tests were identified and implemented (implementation is in progress), see #1579 (comment)
As an example, see the newly implemented files: |
Description of issue or feature request:
The following list captures some areas of interest for testing and some example test cases for each area. For each area it would be useful to:
Test areas:
The text was updated successfully, but these errors were encountered: