-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 6583 - Fix CI on older branches
Bug Description: Test execution on older branches (1.4.x, some 2.x) fails. We use the same Fedora base image across all branches, but it contains newer toolchain and doesn't have some build dependencies. Fix Description: Use appropriate images: EL8 for 1.4.x, EL9 for 2.x, EL10/Fedora for 3.x. Fixes: #6583
- Loading branch information
Showing
6 changed files
with
156 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,40 @@ | ||
import os | ||
import sys | ||
import glob | ||
import json | ||
|
||
suites = next(os.walk('dirsrvtests/tests/suites/'))[1] | ||
# If we have arguments passed to the script, use them as the test names to run | ||
if len(sys.argv) > 1: | ||
suites = sys.argv[1:] | ||
valid_suites = [] | ||
# Validate if the path is a valid file or directory with files | ||
for suite in suites: | ||
test_path = os.path.join("dirsrvtests/tests/suites/", suite) | ||
if os.path.exists(test_path) and not os.path.islink(test_path): | ||
if os.path.isfile(test_path) and test_path.endswith(".py"): | ||
valid_suites.append(suite) | ||
elif os.path.isdir(test_path): | ||
valid_suites.append(suite) | ||
suites = valid_suites | ||
|
||
# Filter out snmp as it is an empty directory: | ||
suites.remove('snmp') | ||
else: | ||
# Use tests from the source | ||
suites = next(os.walk('dirsrvtests/tests/suites/'))[1] | ||
|
||
# Run each replication test module separately to speed things up | ||
suites.remove('replication') | ||
repl_tests = glob.glob('dirsrvtests/tests/suites/replication/*_test.py') | ||
suites += [repl_test.replace('dirsrvtests/tests/suites/', '') for repl_test in repl_tests] | ||
suites.sort() | ||
# Filter out snmp as it is an empty directory: | ||
suites.remove('snmp') | ||
|
||
# Filter out webui because of broken tests | ||
suites.remove('webui') | ||
|
||
# Run each replication test module separately to speed things up | ||
suites.remove('replication') | ||
repl_tests = glob.glob('dirsrvtests/tests/suites/replication/*_test.py') | ||
suites += [repl_test.replace('dirsrvtests/tests/suites/', '') for repl_test in repl_tests] | ||
suites.sort() | ||
|
||
suites_list = [{ "suite": suite} for suite in suites] | ||
matrix = {"include": suites_list} | ||
|
||
print(json.dumps(matrix)) | ||
print(json.dumps(matrix)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: npm-audit-ci | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
permissions: | ||
actions: read | ||
packages: read | ||
contents: read | ||
|
||
jobs: | ||
npm-audit-ci: | ||
name: npm-audit-ci | ||
runs-on: ubuntu-latest | ||
container: | ||
image: quay.io/389ds/ci-images:el9test | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run NPM Audit CI | ||
run: cd $GITHUB_WORKSPACE/src/cockpit/389-console && npx --yes audit-ci --config audit-ci.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Validate tests | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
permissions: | ||
actions: read | ||
packages: read | ||
contents: read | ||
|
||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: quay.io/389ds/ci-images:el9test | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run testimony | ||
if: always() | ||
run: testimony validate -c dirsrvtests/testimony.yaml dirsrvtests/tests/suites | ||
|
||
- name: Check for duplicate IDs | ||
if: always() | ||
run: python3 dirsrvtests/check_for_duplicate_ids.py dirsrvtests/tests/suites |