Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ jobs:
registry_username: ${{ secrets.QUAY_IMAGE_SCLORG_BUILDER_USERNAME }}
registry_token: ${{ secrets.QUAY_IMAGE_SCLORG_BUILDER_TOKEN }}
dockerfile: Dockerfile.daily-tests
tag: "0.6.5"
tag: "0.7.0"
image_name: "upstream-daily-tests"
quay_application_token: ${{ secrets.QUAY_IMAGE_SCLORG_UPDATE_DESC }}
2 changes: 1 addition & 1 deletion Dockerfile.daily-tests
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM quay.io/fedora/fedora:42

ENV SHARED_DIR="/var/ci-scripts" \
VERSION="42" \
RELEASE_UPSTREAM="0.6.5" \
RELEASE_UPSTREAM="0.7.0" \
UPSTREAM_TMT_REPO="https://github.com/sclorg/sclorg-testing-farm" \
UPSTREAM_TMT_DIR="sclorg-testing-farm" \
HOME="/home/nightly" \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ shellcheck:
./run-shellcheck.sh `git ls-files *.sh`

build_images:
podman build -t quay.io/sclorg/upstream-daily-tests:0.6.5 -f Dockerfile.daily-tests .
podman build -t quay.io/sclorg/upstream-daily-tests:0.7.0 -f Dockerfile.daily-tests .
12 changes: 2 additions & 10 deletions daily_tests/daily_scl_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ SCL_CONTAINERS_UPSTREAM="\
s2i-nodejs-container
"

SCL_S2I_CONTAINERS="\
SCL_CONTAINERS="\
s2i-base-container
s2i-nodejs-container
s2i-php-container
s2i-perl-container
s2i-ruby-container
s2i-python-container
"

SCL_NOS2I_CONTAINTERS="\
varnish-container
nginx-container
httpd-container
Expand All @@ -32,9 +29,6 @@ shift
[[ -z "$1" ]] && { echo "You have to specify type of the test to run. test, test-openshift, test-openshift-pytest, test-openshift-4" && exit 1 ; }
TESTS="$1"
shift
if [[ -z "$SET_TEST" ]]; then
SET_TEST="S2I"
fi
CUR_WD=$(pwd)
echo "Current working directory is: ${CUR_WD}"

Expand Down Expand Up @@ -75,11 +69,9 @@ function clean_ocp4() {
}

function iterate_over_all_containers() {
CONTAINTERS_TO_TEST=$SCL_S2I_CONTAINERS
CONTAINTERS_TO_TEST=$SCL_CONTAINERS
if [[ "${TESTS}" == "test-upstream" ]]; then
CONTAINTERS_TO_TEST=$SCL_CONTAINERS_UPSTREAM
elif [[ "${SET_TEST}" == "NOS2I" ]]; then
CONTAINTERS_TO_TEST=$SCL_NOS2I_CONTAINTERS
fi


Expand Down
2 changes: 0 additions & 2 deletions run_in_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ set -x

TARGET=$1
TESTS=$2
TEST_TYPE=$3

podman run --rm -it \
-v /var/tmp/:/var/tmp/:Z \
-e SHARED_DIR=/var/tmp/ \
-e TARGET=$TARGET \
-e TESTS=$TESTS \
-e TEST_TYPE=$TEST_TYPE \
quay.io/sclorg/daily-tests:latest
27 changes: 4 additions & 23 deletions run_nightly_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,6 @@ else
exit 1
fi

SET_TEST=""
if [[ "${TESTS}" != "test-upstream" ]]; then
if [[ -n "$TEST_TYPE" ]]; then
echo "Test type is set to $TEST_TYPE"
else
echo "TEST_TYPE variable is not set. Please set it to S2I or NOS2I."
exit 1
fi
SET_TEST="$TEST_TYPE"
fi

# Local working directories
CUR_DATE=$(date +%Y-%m-%d)
WORK_DIR="${HOME}/ci-scripts/"
Expand All @@ -35,13 +24,9 @@ LOCAL_LOGS_DIR="${HOME}/logs/"
DAILY_REPORTS_DIR="${SHARED_DIR}/daily_reports_dir/${CUR_DATE}"
TFT_PLAN="nightly/nightly-$TARGET"
DAILY_REPORTS_TESTS_DIR="${DAILY_REPORTS_DIR}/${TARGET}-${TESTS}"
DAILY_SCLORG_TESTS_DIR="${SHARED_DIR}/daily_scl_tests/${CUR_DATE}/${TARGET}-${TESTS}-${SET_TEST}"
DAILY_SCLORG_TESTS_DIR="${SHARED_DIR}/daily_scl_tests/${CUR_DATE}/${TARGET}-${TESTS}"

DIR="${WORK_DIR}/${CUR_DATE}/${TARGET}-${TESTS}-${SET_TEST}"
if [[ "$TESTS" == "test-upstream" ]]; then
DIR="${WORK_DIR}/${CUR_DATE}/${TARGET}-${TESTS}"
DAILY_SCLORG_TESTS_DIR="${SHARED_DIR}/daily_scl_tests/${CUR_DATE}/${TARGET}-${TESTS}"
fi
DIR="${WORK_DIR}/${CUR_DATE}/${TARGET}-${TESTS}"
LOG_FILE="${LOCAL_LOGS_DIR}/${TARGET}-${TESTS}.log"


Expand Down Expand Up @@ -95,12 +80,8 @@ function get_compose() {
}

function run_tests() {
ENV_VARIABLES="-e DEBUG=yes -e OS=$TARGET -e TEST=$TESTS"
if [[ "$TESTS" != "test-upstream" ]]; then
ENV_VARIABLES="$ENV_VARIABLES -e SET_TEST=$SET_TEST"
else
ENV_VARIABLES="$ENV_VARIABLES -e CI=true"
fi
# -e CI=true is set for NodeJS Upstream tests
ENV_VARIABLES="-e DEBUG=yes -e OS=$TARGET -e TEST=$TESTS -e CI=true"
TMT_COMMAND="tmt run -v -v -d -d --all ${ENV_VARIABLES} --id ${DIR} plan --name $TFT_PLAN provision -v -v --how minute --auto-select-network --image ${COMPOSE}"
echo "TMT command is: $TMT_COMMAND" | tee -a "${LOG_FILE}"
touch "${DAILY_SCLORG_TESTS_DIR}/tmt_running"
Expand Down
36 changes: 20 additions & 16 deletions show_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,23 @@ def iter_results_in_directory(self):
print("Show status of all TMT/FMF plans:")
if self.scl_tests_dir.is_dir():
for item in self.scl_tests_dir.iterdir():
if item.is_dir():
if (item / "tmt_running").exists():
running_tmt_plans.append(item.name)
if not item.is_dir():
continue
if (self.scl_tests_dir / item.name / "tmt_running").exists():
running_tmt_plans.append(item.name)
if self.reports_dir.is_dir():
for item in self.reports_dir.iterdir():
if item.is_dir():
if (item / "tmt_success").exists():
success_tmt_plans.append(item.name)
else:
failed_tmt_plans.append(item.name)
for item in self.reports_dir.iterdir():
if item.is_dir():
failed_container_tests.extend(
self.return_failed_tests(self.reports_dir, item)
)
item_dir = self.reports_dir / item.name
print(f"Going throw {item_dir}")
if not item_dir.is_dir():
continue
if (item_dir / "tmt_success").exists():
success_tmt_plans.append(item.name)
else:
failed_tmt_plans.append(item.name)
failed_container_tests.extend(
self.return_failed_tests(self.item_dir, item)
)
if running_tmt_plans:
print("Running TMT plans that are not finished yet:")
print("\n".join(running_tmt_plans))
Expand All @@ -71,13 +73,15 @@ def iter_over_executed_tests(self):
"""View all executed tests in the given directory."""
for item in self.scl_tests_dir.iterdir():
print(f"Inspecting item in '{self.scl_tests_dir}' directory: {item}")
if not item.is_dir():
item_dir = self.scl_tests_dir / item.name
if not item_dir.is_dir():
continue
failed_container_tests = self.return_failed_tests(self.scl_tests_dir, item)
failed_container_tests = self.return_failed_tests(item_dir, item)
if not failed_container_tests:
print(f"No container test failures found in {item}.")
continue
print(f"!!!!Failed container tests are: {failed_container_tests}!!!!")
print(f"!!!!Failed container tests for {item.name}!!!!\n")
print({"\n".join(failed_container_tests)})

def show_all_available_tests(self):
print("All previous available tests are:")
Expand Down