Add initial TestArtifact() abstraction class to testutils

Description

''Goals: Have abstracted anything within the tests which deals with the internals of an artifact into a TestArtifact class. This should not need additional tests, and should leave us with all tests still passing.''

This adds the initial Artifact 'abstractions', taking existing test methods into a dedicated Artifact class. The class is accessed via an instance attribute of the generic Cli() fixture. This is in preperation for AaaP, to ensure existing tests pass whilst creating an entry point for further abstractions when necessary.

Changes proposed in this merge request:

  • Add artifact class, accessed via instance attr of existing cli() fixture
  • Move over remove_artifact_from_cache() & local buildtree extract context managers, providing extendable 'subdir' extract private method. Also add get_digest & is_cached() methods for interacting with cas resolve_ref() & cas.contains().
  • Add optional check_exists parameter to cascache.py _reachable_refs_dir(), removing the need to externally parse the 'reachable' set to ensure file digests actually exist in artifactshare has_artifact().

This merge request, when approved, will close: #945 (closed)


Edited by Tom Pollard

Merge request reports

Loading