예제 #1
0
def microvm_image_fetcher():
    """Return a borg object that knows about fetching microvm images.

    If `ENV_TEST_IMAGES_S3_BUCKET` is set in the environment, target the bucket
    specified therein, else use the default.
    """
    if ENV_TEST_IMAGES_S3_BUCKET in os.environ:
        test_images_s3_bucket = os.environ.get(ENV_TEST_IMAGES_S3_BUCKET)
    else:
        test_images_s3_bucket = DEFAULT_TEST_IMAGES_S3_BUCKET

    return MicrovmImageS3Fetcher(test_images_s3_bucket)
예제 #2
0
    TEST_DIR = "integration_tests"
    collect_ignore = [
        os.path.join(SCRIPT_FOLDER, "{}/style".format(TEST_DIR)),
        os.path.join(SCRIPT_FOLDER,
                     "{}/build/test_dependencies.py".format(TEST_DIR))
    ]


def _test_images_s3_bucket():
    """Auxiliary function for getting this session's bucket name."""
    return os.environ.get(defs.ENV_TEST_IMAGES_S3_BUCKET,
                          defs.DEFAULT_TEST_IMAGES_S3_BUCKET)


ARTIFACTS_COLLECTION = ArtifactCollection(_test_images_s3_bucket())
MICROVM_S3_FETCHER = MicrovmImageS3Fetcher(_test_images_s3_bucket())


# pylint: disable=too-few-public-methods
class ResultsDumperInterface:
    """Interface for dumping results to file."""
    def dump(self, result):
        """Dump the results in JSON format."""


# pylint: disable=too-few-public-methods
class NopResultsDumper(ResultsDumperInterface):
    """Interface for dummy dumping results to file."""
    def dump(self, result):
        """Do not do anything."""