Skip to content

Commit 532ad42

Browse files
committed
Switches jd for contestutil when comparing scoreboards
1 parent e503815 commit 532ad42

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

provision-contest/ansible/EOC/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ Only the `repo`, `contest`, `contest_id`, and `dj_*` variables are required. Whe
3030
- `contest` must be the externalID.
3131
- `contest_id` must be the internalID. (cID)
3232
- `jd_loc` must point to the location of a [`jd` binary](https://github.com/josephburnett/jd/releases/tag/v1.6.1). Used for comparing diffs.
33+
- `contestutil_loc` must point to the location of [`contestUtil.sh`](https://github.com/icpctools/icpctools/releases). Used for comparing diffs.
3334

3435
```yaml
3536
repo: /home/mart/icpc/wf_repo
3637
contest: bapc2022
3738
contest_id: 2
3839
jd_loc: /home/mart/icpc/EOC/jd
40+
contestutil_loc: /home/mart/Downloads/contestUtil/contestUtil.sh
3941

4042
dj_url: https://judge.gehack.nl
4143
dj_url_api_suffix: api/v4
@@ -76,4 +78,4 @@ The playbook has multiple tags:
7678
- teams
7779

7880
### Known limitations
79-
- The checks that verify whether the jsons are the same are *very* simple and I (Mart) have not yet found a reasonable way of actually checking them in a nice manner from ansible. Them matching would be a bigger red-flag than them having a difference. Still, the playbook fails when a difference is detected! To aid with (manual) verification the results of fetching the jsons is stored in `/tmp/[obj].[sys].json` with `[object]` either "awards" or "scoreboard" and `[sys]` either "dj", "cds", or "other".
81+
- The checks that verify whether the awards.json are the same is *very* simple and I (Mart) have not yet found a reasonable way of actually checking them in a nice manner from ansible. Them matching would be a bigger red-flag than them having a difference. Still, the playbook fails when a difference is detected! To aid with (manual) verification the results of fetching the jsons is stored in `/tmp/awards.[sys].json` with `[sys]` either "dj", or "cds".

provision-contest/ansible/EOC/main.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,21 @@
9898
when: other_available
9999

100100
- name: Does Dj == other for scoreboard
101-
shell: "{{ jd_loc }} /tmp/scoreboard.dj.json /tmp/scoreboard.other.json"
102-
when: other_available
101+
block:
102+
- name: Check for differences
103+
shell: "{{ contestutil_loc }} ScoreboardUtil /tmp/scoreboard.dj.json /tmp/scoreboard.other.json"
104+
when: other_available
105+
register: cul
106+
107+
- name: Print output
108+
ansible.builtin.debug:
109+
msg: "{{ cul.stdout | split('\n')}}"
110+
111+
- name: Fail if the scoreboard does not match
112+
ansible.builtin.fail:
113+
msg: "Scoreboard does not match, check /tmp/scoreboard.dj.json and /tmp/scoreboard.other.json"
114+
when:
115+
- "'No differences found.' not in cul.stdout"
103116

104117
- name: Compare awards.json
105118
tags: all, compare, awards

0 commit comments

Comments
 (0)