-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from fangohr/feat-023
Feat 023
- Loading branch information
Showing
8 changed files
with
119 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
# This Ansible playbook runs Fidimag tests. This works because pytest has a | ||
# non-zero exit status if a test fails, and Make returns a non-zero exit status | ||
# if a command returns a non-zero exit status. | ||
|
||
# The following task construction exists because XPRA sometimes fails silently, | ||
# apparently stochastically. Hence we attempt to create a number of virtual | ||
# displays using xpra, and test each one. If one of them exists, we continue | ||
# with it. If they all fail, we exit. This is all done to ensure that the | ||
# finmag tests pass, since some of them require a display. | ||
|
||
- name: Ensure that xpra is installed | ||
apt: | ||
pkg=xpra | ||
state=latest | ||
update_cache=yes | ||
cache_valid_time=86400 | ||
sudo: yes | ||
|
||
- name: Create multiple virtual displays and re-probe them. | ||
shell: xpra start :{{ item }} && xpra list | ||
with_items: XPRA_DISPLAYS | ||
ignore_errors: yes | ||
sudo: yes | ||
|
||
- name: Obtain the display ID of one successful live display. | ||
shell: xpra list | grep -m 1 "LIVE.*" | grep -Go [0-9]*$ | ||
register: successful_display | ||
sudo: yes | ||
|
||
# Finally, run some tests. | ||
|
||
- name: Run tests. | ||
command: make test | ||
args: | ||
chdir: "{{ FIDIMAG_INSTALL_PATH }}" | ||
environment: | ||
DISPLAY: ":{{ successful_display.stdout }}" | ||
PYTHONPATH: "{{ FIDIMAG_INSTALL_PATH }}" | ||
LD_LIBRARY_PATH: "{{ FIDIMAG_INSTALL_PATH }}/local/lib" | ||
sudo: yes | ||
|
||
# Cleanup. | ||
|
||
- name: Stop xpra sessions | ||
command: xpra stop :{{ item }} | ||
with_items: XPRA_DISPLAYS | ||
ignore_errors: yes | ||
sudo: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,16 @@ | ||
--- | ||
FIDIMAG_REPO_URL: https://github.com/computationalmodelling/fidimag.git | ||
FIDIMAG_INSTALL_PATH: /opt/fidimag | ||
FIDIMAG_VERSION: HEAD | ||
FIDIMAG_VERSION: HEAD | ||
|
||
XPRA_DISPLAYS: | ||
- 25 | ||
- 30 | ||
- 36 | ||
- 49 | ||
- 50 | ||
- 64 | ||
- 75 | ||
- 81 | ||
- 90 | ||
- 99 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
--- | ||
# This Ansible role installs Nmag on the virtual machine. | ||
|
||
- include: install_required_debian_packages.yml | ||
- include: download_and_extract_nmag_tarball.yml | ||
- include: compile_nmag.yml | ||
- include: add_nmag_to_PATH.yml dest=/etc/profile.d/nmag.sh | ||
- include: test.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
# This Ansible playbook runs Nmag tests. | ||
|
||
- name: Configure Nmag to run tests. | ||
command: "{{ NMAG_INSTALL_PREFIX }}/{{ NMAG_VERSION }}/nsim/bin/nsim {{ NMAG_INSTALL_PREFIX }}/{{ NMAG_VERSION }}/nsim/tests/config/setup.py" | ||
args: | ||
chdir: "{{ NMAG_INSTALL_PREFIX }}/{{ NMAG_VERSION }}/nsim/tests/config" | ||
sudo: yes | ||
|
||
- name: Run fast tests. | ||
command: make check | ||
args: | ||
chdir: "{{ NMAG_INSTALL_PREFIX }}/{{ NMAG_VERSION }}/nsim/tests" | ||
sudo: yes | ||
|
||
- name: Run slow tests. | ||
command: make checkslow | ||
args: | ||
chdir: "{{ NMAG_INSTALL_PREFIX }}/{{ NMAG_VERSION }}/nsim/tests" | ||
sudo: yes | ||
|
||
- name: Run MPI tests. | ||
command: make checkmpi | ||
args: | ||
chdir: "{{ NMAG_INSTALL_PREFIX }}/{{ NMAG_VERSION }}/nsim/tests" | ||
sudo: yes |