Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Andrei-Stepanov/7c658bc4bea555e79bc238c4325b55e5 to your computer and use it in GitHub Desktop.
Save Andrei-Stepanov/7c658bc4bea555e79bc238c4325b55e5 to your computer and use it in GitHub Desktop.
+ git config --global user.email ci@lists.fedoraproject.org
+ git config --global user.name 'OSCI team'
+ '[' -n https://pagure.io/standard-test-roles.git -a -n ttomecek ']'
+ echo 'Use repo: https://pagure.io/standard-test-roles.git and branch: ttomecek'
Use repo: https://pagure.io/standard-test-roles.git and branch: ttomecek
+ git remote rm proposed
error: Could not remove config section 'remote.proposed'
+ true
+ git remote add proposed https://pagure.io/standard-test-roles.git
+ git fetch proposed
From https://pagure.io/standard-test-roles
* [new branch] 122 -> proposed/122
* [new branch] basic -> proposed/basic
* [new branch] cipipeline -> proposed/cipipeline
* [new branch] common -> proposed/common
* [new branch] master -> proposed/master
* [new branch] ttomecek -> proposed/ttomecek
+ git checkout origin/master
Note: checking out 'origin/master'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at c69ab3b... Merge #136 `remove container if can't install Ansible dependencies`
+ git merge --no-ff proposed/ttomecek -m 'Merge PR'
Merge made by the 'recursive' strategy.
roles/standard-test-basic/tasks/main.yml | 8 +++++---
roles/standard-test-beakerlib/tasks/main.yml | 7 ++++---
roles/str-common/tasks/main.yml | 2 +-
roles/str-common/tasks/pkgs.yml | 6 ++++++
4 files changed, 16 insertions(+), 7 deletions(-)
+ echo 'Test next changes:'
Test next changes:
+ git show -m
commit 6ff5c828a44207dd95fe3f1995500c01dbb072ea (from c69ab3becf001c16c624081102d15139b772215a)
Merge: c69ab3b e19f6ee
Author: OSCI team <ci@lists.fedoraproject.org>
Date: Tue Mar 6 09:10:26 2018 +0000
Merge PR
diff --git a/roles/standard-test-basic/tasks/main.yml b/roles/standard-test-basic/tasks/main.yml
index 9a32655..25ca4bb 100644
--- a/roles/standard-test-basic/tasks/main.yml
+++ b/roles/standard-test-basic/tasks/main.yml
@@ -32,13 +32,15 @@
with_items:
- "{{ tests }}"
+ always:
- include_role:
name: str-common
tasks_from: end.yml
- # Can't go in block. See
- # https://github.com/ansible/ansible/issues/20736
- - name: Check the results
+ # This task must be run at the end. This playbook must fail if one of the
+ # tests was failed.
+ - name: Check that all tests have PASS status
shell: grep "^FAIL" {{ remote_artifacts }}/test.log
register: test_fails
failed_when: test_fails.stdout or test_fails.stderr
+ # After this task cannot follow any more tasks.
diff --git a/roles/standard-test-beakerlib/tasks/main.yml b/roles/standard-test-beakerlib/tasks/main.yml
index 3bdf77b..4af2b5a 100644
--- a/roles/standard-test-beakerlib/tasks/main.yml
+++ b/roles/standard-test-beakerlib/tasks/main.yml
@@ -117,9 +117,10 @@
name: str-common
tasks_from: end.yml
- # Can't go in block. See
- # https://github.com/ansible/ansible/issues/20736
- - name: Check the results
+ # This task must be run at the end. This playbook must fail if one of the
+ # tests was failed.
+ - name: Check that all tests have PASS status
shell: grep "^FAIL" {{ remote_artifacts }}/test.log
register: test_fails
failed_when: test_fails.stdout or test_fails.stderr
+ # After this task cannot follow any more tasks.
diff --git a/roles/str-common/tasks/main.yml b/roles/str-common/tasks/main.yml
index f259710..ad3d9c5 100644
--- a/roles/str-common/tasks/main.yml
+++ b/roles/str-common/tasks/main.yml
@@ -16,7 +16,7 @@
- import_tasks: pkgs.yml
- name: Make artifacts directory
- file: path={{ remote_artifacts }} state=directory owner=root mode=755 recurse=yes
+ file: path={{ remote_artifacts }} state=directory mode=755 recurse=yes
# Next task requires rsync on test environment
- name: Copy tests to test environment
diff --git a/roles/str-common/tasks/pkgs.yml b/roles/str-common/tasks/pkgs.yml
index 6e75ae9..1cab555 100644
--- a/roles/str-common/tasks/pkgs.yml
+++ b/roles/str-common/tasks/pkgs.yml
@@ -27,3 +27,9 @@
verbosity: 1
- include_tasks: "pkgs-{{ pkg_mgr | trim}}.yml"
+ # `become` param was added as an exception by request userspace
+ # Containerization Team. In particular by ttomecek@. Adding this parameter
+ # as it doesn't contradict with current workflow. Their workflow requires to
+ # run tests as ordinary user. In future this parameter is a question to
+ # remove.
+ become: true
commit 6ff5c828a44207dd95fe3f1995500c01dbb072ea (from e19f6ee1f9e7d45e3c197f11bae669f6d3bc14f1)
Merge: c69ab3b e19f6ee
Author: OSCI team <ci@lists.fedoraproject.org>
Date: Tue Mar 6 09:10:26 2018 +0000
Merge PR
diff --git a/inventory/standard-inventory-docker b/inventory/standard-inventory-docker
index b8d625d..cb1df71 100755
--- a/inventory/standard-inventory-docker
+++ b/inventory/standard-inventory-docker
@@ -114,6 +114,9 @@ def host(image, docker_extra_args):
try:
subprocess.check_call(install, stdout=sys.stderr.fileno())
except subprocess.CalledProcessError as ex:
+ # Could not install necessary packages to run the tests.
+ # Need to stop and remove the container.
+ subprocess.call(["/usr/bin/docker", "rm", "-f", name ], stdout=null)
raise RuntimeError("Could not install Ansible dependencies in launched container")
# Directory to place artifacts
@@ -175,7 +178,6 @@ def host(image, docker_extra_args):
# Kill the container
with open(log, "w") as f:
subprocess.call(["/usr/bin/docker", "logs", name ], stdout=f.fileno())
- subprocess.call(["/usr/bin/docker", "kill", name ], stdout=null.fileno())
subprocess.call(["/usr/bin/docker", "rm", "-f", name ], stdout=null)
shutil.rmtree(directory)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment