pulp / Pulp-2-Tests

:warning: ⛔️ Pulp2 is EOL as of November 30 2022, for more info visit this link https://pulpproject.org/2022/09/19/pulp-2-eol/. ⛔️ Functional tests for Pulp 2.
https://pulp-2-tests.readthedocs.io/
1 stars 11 forks source link

Refactor of test_remove.py with changes from 4549 #213

Closed bherrin3 closed 5 years ago

bherrin3 commented 5 years ago

Problems

With the refactor of the docker importer's remove function to increase performance, content removal needs to be functional verified.

Solution

The cases covered with content post-count verification for all units:

1. Remove all manifest_lists sequentially.
2. Remove all manifests sequentially.
3. Remove all blobs sequentially.
4. Remove all manifest_lists batch.
5. Remove all manifests batch.
6. Remove all blobs batch.
7. Remove some non-shared manifest lists.
8. Remove some non-shared manifest.
9. Remove some shared manifests lists and verify shared units are not
   recursively removed.
10. Remove some shared manifests and verify shared units are not
    recursively removed.

Fixture Information

The fixture includes:

* 2 relatively independent manifest lists (no shared manifests,
  no shared blobs between them)
* 2 manifest lists that share some (but not all) manifests, and those
  manifest share some (but not all) blobs. This only requires the creation
  of 1 manifest list that shares some content with one of the first
  “independent manifest lists”.
* 2 relatively independent manifests
* 2 manifests that share (some but not all) blobs

In order to sync the content, each content unit must be recursively related
to at least 1 tag.

Test Run

2.20 or +

Test session starts (platform: linux, Python 3.7.3, pytest 4.1.0, pytest-sugar 0.9.2)
cachedir: .pytest_cache
rootdir: /home/herring/git/Pulp-2-Tests, inifile: pytest.ini
plugins: sugar-0.9.2
collecting ... 
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_01_remove_manifest_list_all_sequential ✓10% █         
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_02_remove_manifest_all_sequential ✓20% ██        
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_03_remove_blob_all_sequential ✓30% ███       
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_04_remove_manifest_list_all_batch ✓40% ████      
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_05_remove_manifest_all_batch ✓50% █████     
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_06_remove_blob_all_batch ✓60% ██████    
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_07_remove_manifest_list_not_shared ✓70% ███████   
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_08_remove_manifest_list_shared ✓80% ████████  
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_09_remove_manifest_not_shared ✓90% █████████ 
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_10_remove_manifest_shared ✓100% ██████████

Results (89.11s):
      10 passed
pytest -svv test_remove.py --disable-warnings  3.40s user 0.21s system 4% cpu 1:29.54 total

< 2.20

pytest -svv test_remove.py --disable-warnings  2.80s user 0.16s system 6% cpu 48.751 total
Test session starts (platform: linux, Python 3.7.3, pytest 4.1.0, pytest-sugar 0.9.2)
cachedir: .pytest_cache
rootdir: /home/herring/git/Pulp-2-Tests, inifile: pytest.ini
plugins: sugar-0.9.2
collecting ... 
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_01_remove_manifest_list_all_sequential ✓10% █         
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_02_remove_manifest_all_sequential ✓20% ██        
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_03_remove_blob_all_sequential ✓30% ███       
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_04_remove_manifest_list_all_batch s40% ████      
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_05_remove_manifest_all_batch s50% █████     
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_06_remove_blob_all_batch s60% ██████    
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_07_remove_manifest_list_not_shared ✓70% ███████   
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_08_remove_manifest_list_shared ✓80% ████████  
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_09_remove_manifest_not_shared ✓90% █████████ 
 pulp_2_tests/tests/docker/api_v2/test_remove.py::RemoveV2ContentTestCase.test_10_remove_manifest_shared ✓100% ██████████

Results (46.12s):
       7 passed
       3 skipped

Notes

Refs and Tags

refs #4549 #5161 closes #5181

nixocio commented 5 years ago

Good job @bherrin3. I specially like all the comments, and permutations.

I have a few minor suggestions. Not blockers.