-
Notifications
You must be signed in to change notification settings - Fork 75
[#697] Github actions to run all PRC tests #772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
d-w-moore
wants to merge
69
commits into
irods:main
Choose a base branch
from
d-w-moore:ghrunner-run-all-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
f7580e9
Github action for running PRC tests
trel 985d853
do not run pam_interactive tests as part of suite
d-w-moore 37273ce
make a copy of read-only repo from which to install PRC
d-w-moore b5c2cc9
irods5
d-w-moore 7ff4da7
chgs to workflow for irods 4 and 5
d-w-moore f395657
ws
d-w-moore d2e8565
save off irods-4 container files
d-w-moore 219d683
preserve old dirs as irods 4 container versions
d-w-moore 40653c3
add "irods_major" as docker compose param
d-w-moore 723a6f0
branch builds for irods 4 and 5
d-w-moore 2057413
fully parameterize irods+version
d-w-moore c3fab7a
send_oneshot now symlink
d-w-moore 316f28d
add test options -n, -b to start_containser
d-w-moore bb799d4
add stop_containers
d-w-moore 8ce39c3
no symlinks allowed in dockerfile context
d-w-moore b1d1e10
provide writeable dir 'test-data' for pool_test
d-w-moore 72fc1f5
chown 'test-data'
d-w-moore 3db0d0b
irods 5 tests
d-w-moore 4b11078
docker image to list available package versions for a linux_vsn
d-w-moore dbc4d6a
health check and container synchronization
d-w-moore 17e34f4
[_502]{_SQ] experimental test harness using containers
d-w-moore 4a62021
misc py irods 5 chgs
d-w-moore 63c19c1
utility script to generate docker images
d-w-moore c3e8648
carry forward args in create-docker-images
d-w-moore 64331a8
changes to test asserts involving regex
d-w-moore 9076727
healthcheck replaces oneshot mechanism
d-w-moore 98903fd
correct iRODS version detect for server start
d-w-moore 7d7dc6b
change image
d-w-moore 918de89
preliminary local suite test
d-w-moore 230ebf4
include script for local suite run.
d-w-moore d340e5d
print iRODS and Python Interpreter versions in header
d-w-moore b15d2d2
remove redundenat script
d-w-moore a294448
refactor for /pyN
d-w-moore c9a2731
column check test now filters by server version
d-w-moore a02fea0
integrate local PRC suite run
d-w-moore 2d91709
rename new workflow
d-w-moore 7b52877
name output include both python and iRODS
d-w-moore 36f9643
amend workflow script
d-w-moore f424c58
debugchanges
d-w-moore abe2232
can start-bg server (for /tmp/irods.log)
d-w-moore 4470fd7
TLS initializes correctly but Bats tests still fail
d-w-moore 76ebc9e
get test working by adding sleep
d-w-moore 8edca62
action name in run-the-tests
d-w-moore 580efda
save changes for test under github actions
d-w-moore 1ad07be
whoami
d-w-moore b2d8a68
move chown
d-w-moore 0b59cd6
chmod for world
d-w-moore 74546ff
--timeout instead of --time
d-w-moore c32dc94
debug prints
d-w-moore 7678844
run test000* as root
d-w-moore 39b1cc1
debug output for iinit; limit matrix
d-w-moore 8efb989
partition test000 from test001-9
d-w-moore 79528de
add iRODS 4 back into matrix
d-w-moore 2b56ff4
fill out matrix with low,high choices
d-w-moore 916fdf8
do not use oneshot send/recv mechanism
d-w-moore 88ae56b
iinit_as_rods earlier
d-w-moore 57bf8d0
revert some debug changes; push to GitHub for retrial of run-bats-tests
d-w-moore 070a7d9
need iinit output once more
d-w-moore a777217
move iinit-as-rods earlier and repeat til success or timeout
d-w-moore ff046bd
clean debug
d-w-moore 98e1105
print VERSION variables before run in container
d-w-moore 7ac93d0
correct failing tests
d-w-moore 5cfcce8
run against iRODS 5.0.2
d-w-moore 20465bb
ws and comments
d-w-moore e7c2294
pass args to test script from outside container
d-w-moore 7a12819
add version checking script
d-w-moore 36b0a5b
update runner.py's new options processing with argparse
d-w-moore cc603f0
argparse related corrrections in runner.py
d-w-moore d093706
delete redundant initializations
d-w-moore File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,30 @@ | ||
name: run-bats-tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
tests: | ||
timeout-minutes: 20 | ||
|
||
name: Python ${{ matrix.python }}, iRODS ${{ matrix.irods_server }} | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./irods/test/harness | ||
strategy: | ||
matrix: | ||
python: ['3.9','3.13'] | ||
irods_server: ['4.3.4','5.0.2'] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build images | ||
run: ./create_docker_images.sh "${{ matrix.irods_server }}" "${{ matrix.python }}" | ||
|
||
- name: run tests | ||
run: | | ||
for script in ../scripts/test00[1-9]*; do | ||
./docker_container_driver.sh -V $script | ||
done |
This file contains hidden or 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,28 @@ | ||
name: run-local-suite | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
tests: | ||
timeout-minutes: 20 | ||
|
||
name: Python ${{ matrix.python }}, iRODS ${{ matrix.irods_server }} | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./irods/test/harness | ||
strategy: | ||
matrix: | ||
python: ['3.9','3.13'] | ||
irods_server: ['4.3.4','5.0.2'] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build images | ||
run: ./create_docker_images.sh "${{ matrix.irods_server }}" "${{ matrix.python }}" | ||
|
||
- name: run tests | ||
run: | | ||
./docker_container_driver.sh -V ../scripts/run_suite_locally.sh |
This file contains hidden or 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,41 @@ | ||
name: run-the-tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
tests: | ||
timeout-minutes: 20 | ||
|
||
name: Python ${{ matrix.python }}, iRODS ${{ matrix.irods_server }} | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./docker-testing | ||
strategy: | ||
matrix: | ||
python: ['3.9','3.13'] | ||
irods_server: ['4.3.4','5.0.2'] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: who am i | ||
run: echo $(id -u) $(id -un) | ||
|
||
- name: Start containers | ||
run: ./start_containers.sh "${{ matrix.irods_server }}" "${{ matrix.python }}" | ||
|
||
- name: run test | ||
run: | | ||
while :; do | ||
client_container=$(docker ps --format "{{.Names}}"|grep python.client) | ||
[ -n "$client_container" ] && break | ||
sleep 1 | ||
done | ||
echo "client_container = [$client_container]" | ||
docker exec "${client_container}" /repo_root/docker-testing/run_tests.sh | ||
|
||
- name: Stop containers | ||
if: always() | ||
run: ./stop_containers.sh "${{ matrix.irods_server }}" "${{ matrix.python }}" |
This file contains hidden or 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 hidden or 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 hidden or 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,42 @@ | ||
The file `$REPO/.github/workflows/run-the-tests.yml` | ||
(where `$REPO` is the /path/to/local/python-irodsclient repository) | ||
contains commands for starting the server and client containers and running the PRC | ||
suite in response to a push or pull-request. | ||
|
||
The tests suite can also be run on any workstation with "docker compose" installed: | ||
|
||
1. cd into top level of $REPO | ||
|
||
2. run: | ||
``` | ||
./docker-testing/start_containers.sh 3.6 | ||
``` | ||
This builds and runs the docker images. "3.6" is the version of python desired. | ||
|
||
3. run: | ||
``` | ||
docker exec <name-of-python-client-container> /repo_root/docker-testing/run_tests.sh | ||
``` | ||
(Note: `/repo_root` is an actual literal path, internal to the container.) | ||
You'll see the test output displayed on the console. At completion, xmlrunner outputs are in /tmp. | ||
|
||
4. use `docker logs -f` with the provider instance name to tail the irods server log output | ||
|
||
DEBUGGING | ||
--------- | ||
We can also to run a specific test that we specify by name: | ||
|
||
``` | ||
$ docker exec -it <name-of-python-client-container> /repo_root/docker_testing/run_tests.sh irods.test.<module>.<class>.<method> | ||
``` | ||
|
||
Optionally we can also enter the PDB command-line debugger at a place of our choosing in the source code, by stopping on a breakpoint, | ||
and then stepping through code. | ||
|
||
The breakpoint can be placed by adding the line | ||
|
||
``` | ||
import pdb;pdb.set_trace() | ||
``` | ||
|
||
immediately before the source line in the test code at which we wish to enter the debugger. |
This file contains hidden or 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,13 @@ | ||
ARG linux_vsn="ubuntu:18.04" | ||
FROM ${linux_vsn} | ||
RUN apt update | ||
RUN apt install -y lsb-release apt-transport-https | ||
RUN apt install -y wget | ||
RUN apt install -y gnupg2 | ||
RUN wget -qO - https://packages.irods.org/irods-signing-key.asc | apt-key add - | ||
RUN echo "deb [arch=amd64] https://packages.irods.org/apt/ $(lsb_release -sc) main" |\ | ||
tee "/etc/apt/sources.list.d/renci-irods.list" | ||
RUN apt update | ||
|
||
ENTRYPOINT ["apt", "list", "-a"] | ||
|
This file contains hidden or 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 @@ | ||
harness-docker-compose.yml |
This file contains hidden or 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 @@ | ||
harness-docker-compose.yml |
This file contains hidden or 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,47 @@ | ||
version: '3' | ||
|
||
services: | ||
irods-catalog: | ||
build: | ||
context: irods_catalog_${irods_major} | ||
# 5432 is exposed by default and can conflict with other postgres containers. | ||
# When the metalnx-db service is no longer needed, this stanza can be removed. | ||
ports: | ||
- "5430:5432" | ||
environment: | ||
- POSTGRES_PASSWORD=testpassword | ||
|
||
python-client: | ||
build: | ||
context: python_client | ||
args: | ||
python_version: ${python_version} | ||
command: | ||
tail -f /dev/null | ||
volumes: | ||
- ${repo_external}:/repo_root:ro | ||
- /tmp/irods-client-share.py-${python_version}:/irods_shared | ||
depends_on: | ||
irods-catalog-provider: | ||
condition: service_healthy | ||
|
||
irods-catalog-provider: | ||
volumes: | ||
- /tmp/irods-client-share.py-${python_version}:/irods_shared | ||
build: | ||
context: irods_catalog_provider_${irods_major} | ||
args: | ||
irods_version: ${irods_version} | ||
shm_size: 500mb | ||
healthcheck: | ||
test: ["CMD", "su", "-", "irods", "-c", "ils || exit 1"] | ||
interval: 10s | ||
timeout: 10s | ||
retries: 3 | ||
#start_period: 20s | ||
#start_interval: 2s | ||
ports: | ||
- "1247:1247" | ||
depends_on: | ||
- irods-catalog | ||
|
This file contains hidden or 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,46 @@ | ||
#!/usr/bin/env python | ||
|
||
from getpass import getpass | ||
from irods.password_obfuscation import encode | ||
import json | ||
import os | ||
import sys | ||
from os import chmod | ||
from os.path import expanduser,exists,join | ||
from getopt import getopt | ||
|
||
|
||
home_env_path = expanduser('~/.irods') | ||
env_file_path = join(home_env_path,'irods_environment.json') | ||
auth_file_path = join(home_env_path,'.irodsA') | ||
|
||
|
||
def do_iinit(host, port, user, zone, password): | ||
if not exists(home_env_path): | ||
os.makedirs(home_env_path) | ||
else: | ||
raise RuntimeError('~/.irods already exists') | ||
|
||
with open(env_file_path,'w') as env_file: | ||
json.dump ( { "irods_host": host, | ||
"irods_port": int(port), | ||
"irods_user_name": user, | ||
"irods_zone_name": zone }, env_file, indent=4) | ||
with open(auth_file_path,'w') as auth_file: | ||
auth_file.write(encode(password)) | ||
chmod (auth_file_path,0o600) | ||
|
||
|
||
def get_kv_pairs_from_cmdline(*args): | ||
arglist = list(args) | ||
while arglist: | ||
k = arglist.pop(0) | ||
v = arglist.pop(0) | ||
yield k,v | ||
|
||
|
||
if __name__ == '__main__': | ||
import sys | ||
args = sys.argv[1:] | ||
dct = {k:v for k,v in get_kv_pairs_from_cmdline(*args)} | ||
do_iinit(**dct) |
This file contains hidden or 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,3 @@ | ||
FROM postgres:12 | ||
|
||
COPY init-user-db.sh /docker-entrypoint-initdb.d/init-user-db.sh |
This file contains hidden or 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,11 @@ | ||
#!/bin/bash | ||
|
||
# Adapted from "Initialization script" in documentation for official Postgres dockerhub: | ||
# https://hub.docker.com/_/postgres/ | ||
set -e | ||
|
||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL | ||
CREATE DATABASE "ICAT"; | ||
CREATE USER irods WITH PASSWORD 'testpassword'; | ||
GRANT ALL PRIVILEGES ON DATABASE "ICAT" to irods; | ||
EOSQL |
This file contains hidden or 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,3 @@ | ||
FROM postgres:16 | ||
|
||
COPY init-user-db.sh /docker-entrypoint-initdb.d/init-user-db.sh |
This file contains hidden or 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,12 @@ | ||
#!/bin/bash | ||
|
||
# Adapted from "Initialization script" in documentation for official Postgres dockerhub: | ||
# https://hub.docker.com/_/postgres/ | ||
set -e | ||
|
||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL | ||
CREATE DATABASE "ICAT"; | ||
CREATE USER irods WITH PASSWORD 'testpassword'; | ||
GRANT ALL PRIVILEGES ON DATABASE "ICAT" to irods; | ||
ALTER DATABASE "ICAT" OWNER TO irods | ||
EOSQL |
This file contains hidden or 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,60 @@ | ||
FROM ubuntu:20.04 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
apt-transport-https \ | ||
gnupg \ | ||
wget \ | ||
&& \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* | ||
|
||
RUN wget -qO - https://packages.irods.org/irods-signing-key.asc | apt-key add - && \ | ||
echo "deb [arch=amd64] https://packages.irods.org/apt/ focal main" | tee /etc/apt/sources.list.d/renci-irods.list | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
libcurl4-gnutls-dev \ | ||
jq \ | ||
python3 \ | ||
python3-distro \ | ||
python3-jsonschema \ | ||
python3-pip \ | ||
python3-psutil \ | ||
python3-requests \ | ||
rsyslog \ | ||
unixodbc \ | ||
gawk \ | ||
&& \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* | ||
|
||
ARG irods_version=4.3.1 | ||
ARG irods_package_version_suffix=-0~focal | ||
ARG irods_package_version=${irods_version}${irods_package_version_suffix} | ||
ARG irods_resource_plugin_version=${irods_version}.0${irods_package_version_suffix} | ||
|
||
## TODO : examine. the below command also installed: | ||
#irods-resource-plugin-s3=${irods_resource_plugin_version} | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
irods-database-plugin-postgres=${irods_package_version} \ | ||
irods-runtime=${irods_package_version} \ | ||
irods-server=${irods_package_version} \ | ||
irods-icommands=${irods_package_version} \ | ||
&& \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* | ||
|
||
COPY setup-${irods_version}.input / | ||
RUN mv /setup-${irods_version}.input /irods_setup.input | ||
|
||
WORKDIR / | ||
COPY entrypoint.sh . | ||
COPY send_oneshot . | ||
RUN chmod u+x ./entrypoint.sh | ||
RUN chmod u+x ./send_oneshot | ||
ENTRYPOINT ["./entrypoint.sh"] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to
test[1-9]*