Skip to content

Commit 89d7148

Browse files
committed
ci: fix and improve integration container testing
Use the vault for centos 7 and centos stream 8 Exclude tests/tests_team_plugin_installation_nm.yml since tests/tests_team_nm.yml is excluded. Use grouping to group log lines for better readability. https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#grouping-log-lines Signed-off-by: Rich Megginson <[email protected]>
1 parent 931cdb3 commit 89d7148

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

.github/Dockerfile.c7-network-role

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM quay.io/centos/centos:centos7
22

3-
RUN yum -y install epel-release && \
3+
RUN yum -y install https://dl.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/e/epel-release-7-14.noarch.rpm && \
4+
sed -i '/^mirror/d;s/#\?\(baseurl=http:\/\/\)mirror/\1vault/' /etc/yum.repos.d/*.repo && \
45
yum -y upgrade && \
56
yum -y install NetworkManager NetworkManager-wifi \
67
procps-ng iproute ansible openssh-server openssh-clients \

.github/Dockerfile.c8s-network-role

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM quay.io/centos/centos:stream8
22

3-
RUN dnf -y install dnf-plugins-core epel-release && \
3+
RUN sed -i '/^mirror/d;s/#\(baseurl=http:\/\/\)mirror/\1vault/' /etc/yum.repos.d/*.repo && \
4+
dnf -y install dnf-plugins-core epel-release && \
45
dnf config-manager --set-enabled powertools && \
56
dnf -y upgrade && \
67
dnf -y install NetworkManager NetworkManager-wifi \

.github/run_test.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ EXCLUDE_TESTS_C7='
2020
-e tests/tests_bond_removal_initscripts.yml
2121
-e tests/tests_infiniband_nm.yml
2222
-e tests/tests_team_nm.yml
23+
-e tests/tests_team_plugin_installation_nm.yml
2324
-e tests/tests_unit.yml
2425
-e tests/tests_wireless_nm.yml
2526
'
@@ -37,6 +38,7 @@ EXCLUDE_TESTS_C8S='
3738
-e tests/tests_infiniband_nm.yml
3839
-e tests/tests_integration_pytest.yml
3940
-e tests/tests_team_nm.yml
41+
-e tests/tests_team_plugin_installation_nm.yml
4042
-e tests/tests_unit.yml
4143
-e tests/tests_wireless_wpa3_owe_nm.yml
4244
-e tests/tests_wireless_wpa3_sae_nm.yml
@@ -52,6 +54,7 @@ EXCLUDE_TESTS_C9S='
5254
-e tests/tests_provider_nm.yml
5355
-e tests/tests_regression_nm.yml
5456
-e tests/tests_team_nm.yml
57+
-e tests/tests_team_plugin_installation_nm.yml
5558
-e tests/tests_unit.yml
5659
-e tests/tests_wireless_wpa3_owe_nm.yml
5760
-e tests/tests_wireless_wpa3_sae_nm.yml
@@ -107,6 +110,8 @@ EOF
107110
;;
108111
esac
109112

113+
echo "::group::Start test container"
114+
110115
# shellcheck disable=SC2086
111116
CONTAINER_ID=$(podman run -d $PODMAN_OPTS \
112117
-v "$PROJECT_PATH":$TEST_SOURCE_DIR $CONTAINER_IMAGE)
@@ -116,6 +121,8 @@ if [ -z "$CONTAINER_ID" ];then
116121
exit 1
117122
fi
118123

124+
echo ::endgroup::
125+
119126
function clean_up {
120127
podman rm -f "$CONTAINER_ID" || true
121128
}
@@ -124,6 +131,8 @@ if [ -z "${DEBUG:-}" ];then
124131
trap clean_up ERR EXIT
125132
fi
126133

134+
echo "::group::Set up container for testing"
135+
127136
# Ensure we are testing the latest packages and ignore upgrade failure
128137
sudo podman exec -i "$CONTAINER_ID" /bin/bash -c 'dnf upgrade -y' || true
129138

@@ -163,16 +172,22 @@ for req in meta/collection-requirements.yml tests/collection-requirements.yml; d
163172
fi"
164173
done
165174

175+
echo ::endgroup::
176+
166177
for test_file in $TEST_FILES; do
178+
echo "::group::Test $test_file"
167179
podman exec -i "$CONTAINER_ID" \
168180
/bin/bash -c \
169181
"cd $TEST_SOURCE_DIR;
170182
env ANSIBLE_HOST_KEY_CHECKING=False \
171183
ansible-playbook -i localhost, \
172184
$test_file"
185+
echo ::endgroup::
173186
done
174187

175188
if [ -n "${DEBUG:-}" ];then
189+
echo "::group::Cleanup"
176190
podman exec -it "$CONTAINER_ID" bash
177191
clean_up
192+
echo ::endgroup::
178193
fi

0 commit comments

Comments
 (0)