Reference/API#

ci_watson.artifactory_helpers Module#

Helpers for Artifactory or local big data handling.

Functions#

check_url(*args, **kwargs)

get_bigdata_root([envkey])

Find and returns the path to the nearest big datasets.

get_bigdata(*args[, docopy, timeout, chunk_size])

Acquire requested data from a managed resource to the current directory.

compare_outputs(outputs[, raise_error, ...])

Compare output with "truth" using appropriate diff routine; namely:

generate_upload_params(results_root, ...[, ...])

Generate pattern, target, and test name for generate_upload_schema().

generate_upload_schema(pattern, target, testname)

Write out JSON file to upload results from test to Artifactory storage area.

Classes#

BigdataError

Exception related to big data access.

ci_watson.hst_helpers Module#

Helper module for HST tests.

Functions#

ref_from_image(input_image, reffile_lookup)

Return a list of reference filenames, as defined in the primary header of the given input image, necessary for calibration.

raw_from_asn(asn_file[, suffix])

Return a list of RAW input files in a given ASN.

download_crds(refname, *[, verbose])

Download a CRDS file from HTTP to current directory.

ci_watson.jwst_helpers Module#

Helper module for JWST tests.

Functions#

require_crds_context(required_context)

Ensure CRDS context is a certain level.

ci_watson.resource_tracker Module#

Resource tracking regtest utilities.

Can be used within module-scoped fixtures (often used to run Steps or Pipelines) or within tests.

For uses where the resource usage occurs within a test:

def test_long_step(resource_tracker, request):
    with resource_tracker.track(log=request):
        # something that takes memory and time
        pass

For a module-scoped fixture the resource tracking can be performed in the fixture but the logging/reporting of the resource usage must occur during a test:

@pytest.fixture(scope="module")
def resource_tracker():
    return ResourceTracker()

@pytest.fixture()
def log_tracked_resources(resource_tracker, request):
    def callback():
        resource_tracker.log(request)

    yield callback

@pytest.fixture
def my_long_fixture(resource_tracker):
    with resource_tracker.track():
        # something that takes memory and time
        pass

def test_log_tracked_resources(log_tracked_resources, my_long_fixture):
    log_tracked_resources()

Use of the module-scoped fixture has fixture-reuse considerations similar to the rtdata_module fixture. Having more than one module scoped fixture that uses resource_tracker per module is discouraged (as both will use the same ResourceTracker instance). Parameterization of a fixture using resource_tracker is supported (same as rtdata_module).

Classes#

ResourceTracker()

Track resources used during track context.