From d3da4fe933874493a99c1b38fb9751e28fe6b73e Mon Sep 17 00:00:00 2001 From: Emiliano Heyns Date: Wed, 4 Mar 2020 15:44:11 +0100 Subject: [PATCH 1/3] behave cleanup --- test/behave | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/behave b/test/behave index 2abe5ce558..11962b4dc5 100755 --- a/test/behave +++ b/test/behave @@ -31,7 +31,7 @@ class BooleanAction(argparse.Action): super().__init__(option_strings, dest, nargs=0, **kwargs) def __call__(self, parser, namespace, values, option_string=None): - setattr(namespace, self.dest, option_string.startswith('--no')) + setattr(namespace, self.dest, not option_string.startswith('--no')) class ClientAction(argparse.Action): def __init__(self, option_strings, dest, nargs=None, **kwargs): super().__init__(option_strings, dest, nargs=0, **kwargs) From e5160fd309da8e8fc6ac4fb1a602010e89402ef8 Mon Sep 17 00:00:00 2001 From: Emiliano Heyns Date: Wed, 4 Mar 2020 16:25:54 +0100 Subject: [PATCH 2/3] Travis needs vars to differ --- .travis.yml | 4 ++++ test/behave | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7b9ce51c9b..9c406d30e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,15 +56,19 @@ jobs: - stage: test env: - CLIENT=zotero + - JOB=1 - stage: test env: - CLIENT=zotero + - JOB=2 - stage: test env: - CLIENT=jurism + - JOB=1 - stage: test env: - CLIENT=jurism + - JOB=2 - stage: release if: env(TRAVIS_EVENT_TYPE) != cron AND env(TRAVIS_EVENT_TYPE) != pull_request diff --git a/test/behave b/test/behave index 11962b4dc5..bc18415629 100755 --- a/test/behave +++ b/test/behave @@ -76,7 +76,7 @@ if args.this: sys.argv.extend(['--tags', branch.replace('gh-', '@') ]) args.slow = True -JOB_NUMBER = int(re.search(r'^[0-9]+\.([0-9]+)$', os.environ.get('TRAVIS_JOB_NUMBER', '0.0')).group(1)) +JOB_NUMBER = int(os.environ.get('TRAVIS_JOB_NUMBER', '0')) # because travis only does parallel builds if the env vars differ if JOB_NUMBER == 0: # local run process = subprocess.Popen(['npm', 'run', 'build'], stdout=subprocess.PIPE) while True: @@ -89,11 +89,11 @@ if JOB_NUMBER == 0: # local run sys.exit(returncode) elif args.nightly and not args.tagged: # only test for beta o - args.beta = (JOB_NUMBER % 2) == 1 + args.beta = (JOB_NUMBER == 2) args.slow = True else: - sys.argv.extend(['--tags', f"{'~' if (JOB_NUMBER % 2) == 1 else ''}@test-cluster-1"]) + sys.argv.extend(['--tags', f"{'~' if (JOB_NUMBER == 2) else ''}@test-cluster-1"]) args.slow = args.slow or args.tagged if args.client == 'jurism' or args.beta: From 0350c935f6936c3e5a39ac5bccd396b75a51ad9a Mon Sep 17 00:00:00 2001 From: Emiliano Heyns Date: Wed, 4 Mar 2020 17:08:21 +0100 Subject: [PATCH 3/3] JOB --- test/behave | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/behave b/test/behave index bc18415629..d7ee958f1e 100755 --- a/test/behave +++ b/test/behave @@ -76,7 +76,7 @@ if args.this: sys.argv.extend(['--tags', branch.replace('gh-', '@') ]) args.slow = True -JOB_NUMBER = int(os.environ.get('TRAVIS_JOB_NUMBER', '0')) # because travis only does parallel builds if the env vars differ +JOB_NUMBER = int(os.environ.get('JOB', '0')) # because travis only does parallel builds if the env vars differ if JOB_NUMBER == 0: # local run process = subprocess.Popen(['npm', 'run', 'build'], stdout=subprocess.PIPE) while True: