Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions ci/tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def run(self, start: Optional[bool] = False, end: Optional[bool] = False,
command: Optional[str] = None, **kwargs: Any) -> None:
assert ismuex(start, end, command), 'Arguments are mutually exclusive'

tests_group = os.getenv('TESTS_GROUP', '').lower()

record = copy.deepcopy(self.record)

if start:
Expand All @@ -58,7 +60,8 @@ def run(self, start: Optional[bool] = False, end: Optional[bool] = False,
'git_branch': record['data']['branch'],
'config': {
'im_number': os.getenv('IM_NUMBER'),
'maintainer_email': os.getenv('MAINTAINER')
'maintainer_email': os.getenv('MAINTAINER'),
'tests_group': tests_group
}
}
})
Expand All @@ -73,7 +76,6 @@ def run(self, start: Optional[bool] = False, end: Optional[bool] = False,
})

elif command:
tests_group = os.getenv('TESTS_GROUP', '').lower()
name = kwargs.get('name') or command.split()[0]

start_time = str(datetime.now())
Expand All @@ -84,10 +86,7 @@ def run(self, start: Optional[bool] = False, end: Optional[bool] = False,
'test_end_time': str(datetime.now()),
'module': tests_group,
'function': 'main',
'results': results,
'extras': {
'tests_group': tests_group
}
'results': results
})

if kwargs.get('stdout'):
Expand All @@ -98,6 +97,9 @@ def run(self, start: Optional[bool] = False, end: Optional[bool] = False,
else:
raise RuntimeError('No viable option called, exiting...')

if tests_group:
record['data']['branch'] += '[%s]' % tests_group

self._session.post(self.dashboard_url, json=record, verify=False)

@staticmethod
Expand Down