Add ANSIBLE_TEST_CI env var to integration tests.

This commit is contained in:
Matt Clay 2017-07-12 14:16:46 -07:00
parent 374ea94dc3
commit 20d49af475
2 changed files with 9 additions and 0 deletions

View file

@ -593,6 +593,7 @@ def integration_environment(args, target, cmd):
integration = dict( integration = dict(
JUNIT_OUTPUT_DIR=os.path.abspath('test/results/junit'), JUNIT_OUTPUT_DIR=os.path.abspath('test/results/junit'),
ANSIBLE_CALLBACK_WHITELIST='junit', ANSIBLE_CALLBACK_WHITELIST='junit',
ANSIBLE_TEST_CI=args.metadata.ci_provider,
) )
if args.debug_strategy: if args.debug_strategy:

View file

@ -5,6 +5,7 @@ import json
from lib.util import ( from lib.util import (
display, display,
is_shippable,
) )
from lib.diff import ( from lib.diff import (
@ -19,6 +20,11 @@ class Metadata(object):
self.changes = {} # type: dict [str, tuple[tuple[int, int]] self.changes = {} # type: dict [str, tuple[tuple[int, int]]
self.cloud_config = None # type: dict [str, str] self.cloud_config = None # type: dict [str, str]
if is_shippable():
self.ci_provider = 'shippable'
else:
self.ci_provider = ''
def populate_changes(self, diff): def populate_changes(self, diff):
""" """
:type diff: list[str] | None :type diff: list[str] | None
@ -47,6 +53,7 @@ class Metadata(object):
return dict( return dict(
changes=self.changes, changes=self.changes,
cloud_config=self.cloud_config, cloud_config=self.cloud_config,
ci_provider=self.ci_provider,
) )
def to_file(self, path): def to_file(self, path):
@ -80,5 +87,6 @@ class Metadata(object):
metadata = Metadata() metadata = Metadata()
metadata.changes = data['changes'] metadata.changes = data['changes']
metadata.cloud_config = data['cloud_config'] metadata.cloud_config = data['cloud_config']
metadata.ci_provider = data['ci_provider']
return metadata return metadata