diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-09-29 15:03:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-29 15:03:54 +0100 |
commit | e3b7040cff0ab396c34b4d5d709115ebcded34cc (patch) | |
tree | 06678c7c9f9121b37fadc21871b0433d4ece1e17 /test | |
parent | f9962fb58f9463a9c8969c74871046dbc4c1668c (diff) | |
parent | 766c3f77b11177f8c831000d96b5f90936f12405 (diff) | |
download | rspamd-e3b7040cff0ab396c34b4d5d709115ebcded34cc.tar.gz rspamd-e3b7040cff0ab396c34b4d5d709115ebcded34cc.zip |
Merge pull request #4617 from fatalbanana/multiarch_ci
Run CI on ARM
Diffstat (limited to 'test')
-rwxr-xr-x | test/tools/merge_coveralls.py | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/test/tools/merge_coveralls.py b/test/tools/merge_coveralls.py index ff6736f6e..1d294cc98 100755 --- a/test/tools/merge_coveralls.py +++ b/test/tools/merge_coveralls.py @@ -37,12 +37,14 @@ path_mapping = [ ] parser = argparse.ArgumentParser(description='') -parser.add_argument('--input', required=True, nargs='+', help='input files') +parser.add_argument('--input', nargs='+', help='input files') parser.add_argument('--output', help='output file)') parser.add_argument('--root', default="/rspamd/src/github.com/rspamd/rspamd", help='repository root)') parser.add_argument('--install-dir', default="/rspamd/install", help='install root)') parser.add_argument('--build-dir', default="/rspamd/build", help='build root)') parser.add_argument('--token', help='If present, the file will be uploaded to coveralls)') +parser.add_argument('--parallel', action='store_true', help='If present, this is a parallel build)') +parser.add_argument('--parallel-close', action='store_true', help='If present, close parallel build and exit)') def merge_coverage_vectors(c1, c2): @@ -97,9 +99,37 @@ def prepare_path_mapping(): path_mapping[i] = (new_key, path_mapping[i][1]) +def close_parallel_build(): + j = {'payload':{'status': 'done'}} + j['payload']['build_num'] = os.getenv('DRONE_BUILD_NUMBER') + query_str = {'repo_token': args.token} + try: + r = requests.post('https://coveralls.io/webhook', params=query_str, json=j) + r.raise_for_status() + except requests.exceptions.RequestException as e: + print("Failed to send data to coveralls: %s" % e) + sys.exit() + + try: + response = r.json() + if 'url' in response: + print("[coveralls] URL %s" % response['url']) + if 'error' in response: + print("[coveralls] ERROR: %s" % response['error']) + except json.decoder.JSONDecodeError: + print("Bad response: '%s'" % r.text) + if __name__ == '__main__': args = parser.parse_args() + if args.parallel_close: + close_parallel_build() + sys.exit(0) + + if not args.input: + print("error: the following arguments are required: --input") + sys.exit(1) + repository_root = os.path.abspath(os.path.expanduser(args.root)) install_dir = os.path.normpath(os.path.expanduser(args.install_dir)) build_dir = os.path.normpath(os.path.expanduser(args.build_dir)) @@ -123,6 +153,8 @@ if __name__ == '__main__': if 'service_job_id' not in j1 and 'service_job_id' in j2: j1['service_job_id'] = j2['service_job_id'] + if args.parallel: + j1['parallel'] = True if os.getenv('CIRCLECI'): j1['service_name'] = 'circleci' |