Skip to content

Commit

Permalink
Merge pull request #133 from chummels/fix_gold
Browse files Browse the repository at this point in the history
Fixing gold standard script to work with circle ci
  • Loading branch information
brittonsmith committed May 7, 2020
2 parents a5ed5bd + 28596c1 commit eaaae0c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 9 deletions.
25 changes: 16 additions & 9 deletions tests/gold_standard_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,30 @@

from trident import path as trident_path
import os
import re

def get_gold_standard_version():
f = open(os.path.join(trident_path, '../.travis.yml'), 'r')
f = open(os.path.join(trident_path, '../.circleci/config.yml'), 'r')
yt_gold = None
trident_gold = None
for line in f:
line = line.lstrip()
if line.startswith('YT_GOLD'):
line_list = line.split('=')
yt_gold = line_list[1]
if line.startswith('TRIDENT_GOLD'):
line_list = line.split('=')
trident_gold = line_list[1]
pattern_YT = r"echo 'YT_GOLD=(\S+)'"
pattern_trident = r"echo 'TRIDENT_GOLD=(\S+)'"
match_YT = re.search(pattern_YT, line)
match_trident = re.search(pattern_trident, line)
if match_YT:
yt_gold = match_YT.group(1)
if match_trident:
trident_gold = match_trident.group(1)
f.close()
print()
print('Latest Gold Standard Commit Tags\n')
print('yt = %s' % yt_gold, end='')
print('Trident = %s' % trident_gold)
print('yt = %s' % yt_gold)
print('Trident = %s\n' % trident_gold)
print('To update to them, `git checkout <tag>` in appropriate repository')
assert(yt_gold is not None)
assert(trident_gold is not None)


if __name__ == "__main__":
Expand Down
17 changes: 17 additions & 0 deletions tests/test_gold.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""
Unit test for get_gold_standard_version function
"""

#-----------------------------------------------------------------------------
# Copyright (c) 2017, Trident Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#-----------------------------------------------------------------------------

from gold_standard_versions import \
get_gold_standard_version

def test_gold_standard_versions():
get_gold_standard_version()

0 comments on commit eaaae0c

Please sign in to comment.