Skip to content

Commit a4f114b

Browse files
ssbarneatanwigeetika1618alisonlhart
authored
test: switch from ubuntu-22.04 to 24.04 (#1480)
* test: switch from ubuntu-22.04 to 24.04 * Updated runner.ts * Updated test-setup.sh * Updated test-setup.sh * Reverted changes done on test setup * stop, disabled and masked apparmor * made changes to test-setup.py * updated test setup * Testing disabling artifact creation with navigator runs * Try testing podman outside of the ui tests * Add cgroup manager config as per podman-desktop pull 7266 * updated terminaluitest --------- Co-authored-by: tanwigeetika1618 <[email protected]> Co-authored-by: Shashank Venkat <shvenkat> Co-authored-by: alisonlhart <[email protected]>
1 parent 150021b commit a4f114b

File tree

6 files changed

+56
-25
lines changed

6 files changed

+56
-25
lines changed

.config/dictionary.txt

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ bitness
6565
bthornto
6666
cacheable
6767
cfgs
68+
cgroupfs
6869
charliermarsh
6970
checode
7071
chromedriver

.github/workflows/ci.yaml

+20-5
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
run:
5050
shell: ${{ matrix.shell || 'bash'}}
5151
# The type of runner that the job will run on
52-
runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
52+
runs-on: ${{ matrix.os || 'ubuntu-24.04' }}
5353
# see https://github.com/containers/podman/issues/13609
5454
continue-on-error: ${{ contains(matrix.name, 'macos') && true || false }}
5555
outputs:
@@ -63,15 +63,15 @@ jobs:
6363
continue-on-error:
6464
- false
6565
os:
66-
- ubuntu-22.04
66+
- ubuntu-24.04
6767
task-name:
6868
- docs
6969
name:
7070
- docs
7171
include:
7272
- name: lint
7373
task-name: lint
74-
os: ubuntu-22.04
74+
os: ubuntu-24.04
7575
env:
7676
SKIP_PODMAN: 1
7777
SKIP_DOCKER: 1
@@ -110,7 +110,7 @@ jobs:
110110
if: contains(matrix.shell, 'wsl')
111111
uses: Vampire/[email protected]
112112
with:
113-
distribution: Ubuntu-22.04
113+
distribution: Ubuntu-24.04
114114
set-as-default: "true"
115115
# '-i' seems to be the only option that loads .bashrc file that we need
116116
# https://github.com/Vampire/setup-wsl/discussions/54
@@ -132,6 +132,7 @@ jobs:
132132
dbus
133133
dirmngr
134134
gawk
135+
gcc
135136
git
136137
gpg
137138
gpg-agent
@@ -246,6 +247,20 @@ jobs:
246247
run: |
247248
task package ${{ matrix.env.TASKFILE_ARGS }}
248249
250+
# Temporary step for debugging https://github.com/ansible/vscode-ansible/pull/1480
251+
- name: test podman issue
252+
if: ${{ matrix.name == 'test (linux)' }}
253+
run: |
254+
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
255+
mkdir -p ~/.config/containers
256+
cat <<EOT >> ~/.config/containers/containers.conf
257+
[engine]
258+
cgroup_manager="cgroupfs"
259+
EOT
260+
podman info
261+
ansible-navigator run ./test/testFixtures/terminal/playbook.yml --ee true --ce podman --eei ghcr.io/ansible/community-ansible-dev-tools:latest --mode stdout --pae false
262+
263+
249264
- name: task ${{ matrix.task-name }}
250265
if: "${{ !contains(matrix.name, 'test') }}"
251266
run: task ${{ matrix.task-name }} ${{ matrix.env.TASKFILE_ARGS }}
@@ -344,7 +359,7 @@ jobs:
344359
id-token: write
345360
checks: read
346361

347-
runs-on: ubuntu-22.04
362+
runs-on: ubuntu-24.04
348363

349364
steps:
350365
- name: Merge logs into a single archive

.readthedocs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ submodules:
2121
recursive: true
2222

2323
build:
24-
os: ubuntu-22.04
24+
os: ubuntu-24.04
2525
tools:
2626
python: >- # PyYAML parses it as float `3.1` it it's not an explicit string
27-
3.10
27+
3.12
2828
2929
# Optionally set the version of Python and requirements required
3030
# to build docs

src/features/runner.ts

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ export class AnsiblePlaybookRunProvider {
5959
return;
6060
}
6161
commandLineArgs.push("--ee true");
62+
commandLineArgs.push("--mode stdout");
63+
commandLineArgs.push("--pae false");
6264
commandLineArgs.push(
6365
`--ce ${getContainerEngine(eeSettings.containerEngine)}`,
6466
);

test/ui-test/terminalUiTest.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ describe("Verify the execution of playbook using ansible-navigator command", ()
8989
const text = await terminalView.getText();
9090

9191
// assert with just "Play " rather than "Play name" due to CI output formatting issues
92-
expect(text).contains("Play ");
92+
expect(text.replace(/\s+/g, " ")).contains("PLAY [");
9393
await terminalView.killTerminal();
9494
}
9595
});

tools/test-setup.sh

+30-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# cSpell:ignore RPMS xorg cmdtest corepack xrandr nocolor
2+
# cSpell:ignore RPMS xorg cmdtest corepack xrandr nocolor userns
33
#
44
# This tool is used to setup the environment for running the tests. Its name
55
# name and location is based on Zuul CI, which can automatically run it.
@@ -129,11 +129,35 @@ if [[ -f "/etc/redhat-release" ]]; then
129129
fi
130130
fi
131131

132+
# Fail-fast if run on Windows or under WSL1/2 on /mnt/c because it is so slow
133+
# that we do not support it at all. WSL use is ok, but not on mounts.
134+
WSL=0
135+
if [[ "${OS:-}" == "windows" ]]; then
136+
log error "You cannot use Windows build tools for development, try WSL."
137+
exit 1
138+
fi
139+
if grep -qi microsoft /proc/version >/dev/null 2>&1; then
140+
# resolve pwd symlinks and ensure than we do not run under /mnt (mount)
141+
if [[ "$(pwd -P || true)" == /mnt/* ]]; then
142+
log warning "Under WSL, you must avoid running from mounts (/mnt/*) due to critical performance issues."
143+
fi
144+
WSL=1
145+
fi
146+
132147
if [[ -f "/usr/bin/apt-get" ]]; then
133148
INSTALL=0
134149
# qemu-user-static is required by podman on arm64
135150
# python3-dev is needed for headers as some packages might need to compile
136151

152+
# if [[ "$WSL" == "0" ]] && [[ "$(sysctl -n kernel.apparmor_restrict_unprivileged_userns)" != "0" ]]; then
153+
# log warning "AppArmor restricts unprivileged user namespaces, disabling it for testing. See https://github.com/redhat-developer/vscode-extension-tester/issues/1496"
154+
# sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
155+
156+
# #sudo sysctl stop apparmor
157+
# #sudo sysctl disable apparmor
158+
# #sudo sysctl mask apparmor
159+
# fi
160+
137161
DEBS=(curl git python3-dev python3-venv python3-pip qemu-user-static xvfb x11-xserver-utils libgbm-dev libssh-dev libonig-dev)
138162
# add nodejs to DEBS only if node is not already installed because
139163
# GHA has newer versions preinstalled and installing the rpm would
@@ -202,21 +226,6 @@ if [[ "${OS:-}" == "darwin" && "${SKIP_PODMAN:-}" != '1' ]]; then
202226
}
203227
fi
204228

205-
# Fail-fast if run on Windows or under WSL1/2 on /mnt/c because it is so slow
206-
# that we do not support it at all. WSL use is ok, but not on mounts.
207-
WSL=0
208-
if [[ "${OS:-}" == "windows" ]]; then
209-
log error "You cannot use Windows build tools for development, try WSL."
210-
exit 1
211-
fi
212-
if grep -qi microsoft /proc/version >/dev/null 2>&1; then
213-
# resolve pwd symlinks and ensure than we do not run under /mnt (mount)
214-
if [[ "$(pwd -P || true)" == /mnt/* ]]; then
215-
log warning "Under WSL, you must avoid running from mounts (/mnt/*) due to critical performance issues."
216-
fi
217-
WSL=1
218-
fi
219-
220229
# User specific environment
221230
if ! [[ "${PATH}" == *"${HOME}/.local/bin"* ]]; then
222231
# shellcheck disable=SC2088
@@ -335,7 +344,7 @@ if [[ -n "${CI:-}" ]]; then
335344
fi
336345

337346
# Fail if detected tool paths are not from inside out out/ folder
338-
for CMD in ansible ansible-lint; do
347+
for CMD in ansible ansible-lint ansible-navigator; do
339348
CMD=$(command -v $CMD 2>/dev/null)
340349
[[ "${CMD}" == "$VIRTUAL_ENV"* ]] || {
341350
log error "${CMD} executable is not from our own virtualenv ($VIRTUAL_ENV)"
@@ -344,6 +353,10 @@ for CMD in ansible ansible-lint; do
344353
done
345354
unset CMD
346355

356+
# Validate navigator ability to use ee
357+
#ansible-navigator run ./test/testFixtures/terminal/playbook.yml --ee false --mode stdout
358+
#ansible-navigator run ./test/testFixtures/terminal/playbook.yml --ee true --ce podman --eei ghcr.io/ansible/community-ansible-dev-tools:latest --mode stdout
359+
347360
command -v npm >/dev/null 2>&1 || {
348361
log notice "Installing nodejs stable."
349362
asdf install

0 commit comments

Comments
 (0)