Skip to content

Commit

Permalink
make tests more reliable
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Jan 23, 2024
1 parent bd24a92 commit 2da9d16
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 17 deletions.
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -2144,6 +2144,7 @@ t/scenarios/_common/ansible/roles/thruk_logcache_mysql/vars/main.yml
t/scenarios/_common/ansible/roles/thruk_plugin_editor/tasks/main.yml
t/scenarios/_common/ansible/roles/thruk_plugin_editor/vars/main.yml
t/scenarios/_common/ansible/roles/yum_apt_retry/tasks/main.yml
t/scenarios/_common/ansible/roles/yum_apt_retry/vars/main.yml
t/scenarios/_common/base_images/rocky-nightly/Dockerfile
t/scenarios/_common/docker-compose.yml
t/scenarios/_common/Makefile
Expand Down
2 changes: 1 addition & 1 deletion t/scenarios/_common/ansible/install_role.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ROLE=$1
shift

export ANSIBLE_RETRY_FILES_ENABLED="False"
ansible-playbook -i localhost, -c local -e SITENAME=demo "$@" /dev/stdin <<END
ansible-playbook -f1 -i localhost, -c local -e SITENAME=demo "$@" /dev/stdin <<END
---
- hosts: localhost
roles:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
package:
- npm
- chromium
rpm:
- libxshmfence
deb:
- libxshmfence1
- shell: "sudo su - {{ site }} -c 'npm i puppeteer'"
5 changes: 3 additions & 2 deletions t/scenarios/_common/ansible/roles/local_tests/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
name: yum_apt_retry
vars:
package:
- diffutils
- expect # contains unbuffer
rpm:
- perl-Test-Harness
- perl-ExtUtils-Manifest
- perl-ExtUtils-Install
- diffutils
- expect # contains unbuffer
- lineinfile:
path: /etc/locale.conf
regexp: '^LANG='
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
include_role:
name: yum_apt_retry
vars:
package:
rpm:
- perl-ExtUtils-Manifest
- perl-ExtUtils-Install
- perl-File-Which
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
include_role:
name: yum_apt_retry
vars:
package:
rpm:
- perl-ExtUtils-Manifest
- perl-ExtUtils-Install
- git-core
deb:
- git
package:
- make

- stat: path=/usr/lib/locale/en_US.utf8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
- name: "package yum/apt retry installer: {{ package }}"
shell: "if test -f /usr/bin/apt; then apt install -y {{ package | join(' ') }}; else yum install -y {{ package | join(' ') }}; fi"
shell: |
if test -f /usr/bin/apt; then
apt-get install -y {{ package | join(' ') }} {{ deb | join(' ') }}
else
yum install -y {{ package | join(' ') }} {{ rpm | join(' ') }}
fi
register: install_result
ignore_errors: yes
failed_when: install_result.rc != 0
Expand Down
4 changes: 4 additions & 0 deletions t/scenarios/_common/ansible/roles/yum_apt_retry/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
package: []
rpm: []
deb: []
22 changes: 11 additions & 11 deletions t/scenarios/lmd_federation_multitier_e2e/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ services:
deploy:
resources:
limits:
memory: 300M
memory: 1000M

tier1c:
build: tier1c/
Expand All @@ -71,7 +71,7 @@ services:
deploy:
resources:
limits:
memory: 600M
memory: 1000M

tier1d:
build: tier1d/
Expand All @@ -93,7 +93,7 @@ services:
deploy:
resources:
limits:
memory: 300M
memory: 1000M


tier2a:
Expand All @@ -113,7 +113,7 @@ services:
deploy:
resources:
limits:
memory: 500M
memory: 1000M

tier2b:
build: tier2b/
Expand All @@ -132,7 +132,7 @@ services:
deploy:
resources:
limits:
memory: 300M
memory: 1000M

tier2c:
build: tier2c/
Expand All @@ -150,7 +150,7 @@ services:
deploy:
resources:
limits:
memory: 600M
memory: 1000M

tier2d:
build: tier2d/
Expand All @@ -169,7 +169,7 @@ services:
deploy:
resources:
limits:
memory: 300M
memory: 1000M

tier2e:
build: tier2e/
Expand All @@ -188,7 +188,7 @@ services:
deploy:
resources:
limits:
memory: 300M
memory: 1000M

tier3a:
build: tier3a/
Expand All @@ -206,7 +206,7 @@ services:
deploy:
resources:
limits:
memory: 300M
memory: 1000M

tier3b:
build: tier3b/
Expand All @@ -224,7 +224,7 @@ services:
deploy:
resources:
limits:
memory: 600M
memory: 1000M

tier3c:
build: tier3c/
Expand All @@ -242,4 +242,4 @@ services:
deploy:
resources:
limits:
memory: 300M
memory: 1000M

0 comments on commit 2da9d16

Please sign in to comment.