File tree Expand file tree Collapse file tree 3 files changed +58
-1
lines changed
Expand file tree Collapse file tree 3 files changed +58
-1
lines changed Original file line number Diff line number Diff line change 55- include : install_dependencies_from_packages.yml
66- include : make_fidimag.yml
77- include : set_paths.yml
8+ - include : test.yml
Original file line number Diff line number Diff line change 1+ ---
2+ # This Ansible playbook runs Fidimag tests. This works because pytest has a
3+ # non-zero exit status if a test fails, and Make returns a non-zero exit status
4+ # if a command returns a non-zero exit status.
5+
6+ # The following task construction exists because XPRA sometimes fails silently,
7+ # apparently stochastically. Hence we attempt to create a number of virtual
8+ # displays using xpra, and test each one. If one of them exists, we continue
9+ # with it. If they all fail, we exit. This is all done to ensure that the
10+ # finmag tests pass, since some of them require a display.
11+
12+ - name : Ensure that xpra is installed
13+ apt :
14+ pkg=xpra
15+ state=latest
16+ update_cache=yes
17+ cache_valid_time=86400
18+ sudo : yes
19+
20+ - name : Create multiple virtual displays and re-probe them.
21+ shell : xpra start :{{ item }} && xpra list
22+ with_items : XPRA_DISPLAYS
23+ ignore_errors : yes
24+
25+ - name : Obtain the display ID of one successful live display.
26+ shell : xpra list | grep -m 1 "LIVE.*" | grep -Go [0-9]*$
27+ register : successful_display
28+
29+ # Finally, run some tests.
30+
31+ - name : Run tests.
32+ command : make test
33+ args :
34+ chdir : " {{ FIDIMAG_INSTALL_PATH }}"
35+ environment :
36+ DISPLAY : " :{{ successful_display.stdout }}"
37+ sudo : yes
38+
39+ # Cleanup.
40+
41+ - name : Stop xpra sessions
42+ command : xpra stop :{{ item }}
43+ with_items : XPRA_DISPLAYS
44+ ignore_errors : yes
Original file line number Diff line number Diff line change 11---
22FIDIMAG_REPO_URL : https://github.com/computationalmodelling/fidimag.git
33FIDIMAG_INSTALL_PATH : /opt/fidimag
4- FIDIMAG_VERSION : HEAD
4+ FIDIMAG_VERSION : HEAD
5+
6+ xpra_displays :
7+ - 25
8+ - 30
9+ - 36
10+ - 49
11+ - 50
12+ - 64
13+ - 75
14+ - 81
15+ - 90
16+ - 99
You can’t perform that action at this time.
0 commit comments