Skip to content

Commit 78aa29c

Browse files
authored
Replace extra sanity test runner with antsibull-nox. (#836)
1 parent 33ee895 commit 78aa29c

File tree

7 files changed

+66
-66
lines changed

7 files changed

+66
-66
lines changed

.azure-pipelines/azure-pipelines.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ stages:
7070
targets:
7171
- name: Sanity
7272
test: 'devel/sanity/1'
73-
- name: Sanity Extra # Only on devel
74-
test: 'devel/sanity/extra'
7573
- name: Units
7674
test: 'devel/units/1'
7775

.github/workflows/nox.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
# Copyright (c) Ansible Project
3+
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4+
# SPDX-License-Identifier: GPL-3.0-or-later
5+
6+
name: nox
7+
'on':
8+
push:
9+
branches:
10+
- main
11+
- stable-*
12+
pull_request:
13+
# Run CI once per day (at 08:00 UTC)
14+
schedule:
15+
- cron: '0 8 * * *'
16+
workflow_dispatch:
17+
18+
jobs:
19+
nox:
20+
runs-on: ubuntu-latest
21+
name: "Run extra sanity tests"
22+
steps:
23+
- name: Check out collection
24+
uses: actions/checkout@v4
25+
with:
26+
persist-credentials: false
27+
- name: Run nox
28+
uses: ansible-community/antsibull-nox@main

antsibull-nox.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
# SPDX-FileCopyrightText: Ansible Project
4+
5+
[sessions]
6+
7+
[sessions.extra_checks]
8+
run_no_unwanted_files = true
9+
no_unwanted_files_module_extensions = [".py"]
10+
no_unwanted_files_yaml_extensions = [".yml"]
11+
run_action_groups = false

noxfile.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
# SPDX-FileCopyrightText: Ansible Project
4+
5+
# /// script
6+
# dependencies = ["nox>=2025.02.09", "antsibull-nox"]
7+
# ///
8+
9+
import sys
10+
11+
import nox
12+
13+
14+
try:
15+
import antsibull_nox
16+
except ImportError:
17+
print("You need to install antsibull-nox in the same Python environment as nox.")
18+
sys.exit(1)
19+
20+
21+
antsibull_nox.load_antsibull_nox_toml()
22+
23+
24+
# Allow to run the noxfile with `python noxfile.py`, `pipx run noxfile.py`, or similar.
25+
# Requires nox >= 2025.02.09
26+
if __name__ == "__main__":
27+
nox.main()

tests/sanity/extra/no-unwanted-files.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/sanity/extra/no-unwanted-files.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

tests/utils/shippable/sanity.sh

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,12 @@
22

33
set -o pipefail -eux
44

5-
declare -a args
6-
IFS='/:' read -ra args <<< "$1"
7-
8-
group="${args[1]}"
9-
105
if [ "${BASE_BRANCH:-}" ]; then
116
base_branch="origin/${BASE_BRANCH}"
127
else
138
base_branch=""
149
fi
1510

16-
if [ "${group}" == "extra" ]; then
17-
# ansible-galaxy -vvv collection install community.internal_test_tools
18-
git clone --single-branch --depth 1 https://github.com/ansible-collections/community.internal_test_tools.git ../internal_test_tools
19-
20-
../internal_test_tools/tools/run.py --color
21-
exit
22-
fi
23-
2411
# shellcheck disable=SC2086
2512
ansible-test sanity --color -v --junit ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} \
2613
--docker --base-branch "${base_branch}" \

0 commit comments

Comments
 (0)