Skip to content
Open
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
154 changes: 77 additions & 77 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
version: 2.1
executors:
rocky8: &rocky8-executor
default:
docker:
- image: tools-ext-01.ccr.xdmod.org/xdmod-job-performance:x86_64-rockylinux8.9.20231119-v11.0.0-1.0-04
- image: cimg/base:current
jobs:
build:
parameters:
os:
type: executor
type: string
install-type:
type: string
executor: << parameters.os >>
executor: default
environment:
COMPOSER_ALLOW_SUPERUSER: 1
XDMOD_REALMS: 'jobs,storage,cloud,resourcespecifications,supremm,jobefficiency'
Expand All @@ -23,110 +23,110 @@ jobs:
REG_TEST_BASE: /../../../../../project/tests/artifacts/regression/current
steps:
- checkout
- setup_remote_docker
- run:
name: Update nodejs
command: dnf module -y reset nodejs && dnf module -y install nodejs:16
name: Start up the Docker Containers
command: >
docker compose -f tests/playwright/Docker/docker-compose.yml up -d
- run:
name: Checkout XDMoD
command: |
git clone --depth=1 https://github.com/ubccr/xdmod.git $XDMOD_SRC_DIR
name: 'Grab latest release version of XDMoD (!! NOTE: Update branch / user before merging !!!)'
command: git clone --branch=main https://github.com/ubccr/xdmod.git ~/xdmod
- run:
name: Link the SUPREMM module into the XDMoD Source Directory
name: Copy Files into Docker Containers
command: |
ln -s `pwd` $XDMOD_SRC_DIR/open_xdmod/modules/supremm
# We need to update our acct before we can enable docker layer caching.
# - setup_remote_docker:
# docker_layer_caching: true
# Download and cache dependencies
docker cp ~/xdmod xdmod:/xdmod
docker cp ~/project xdmod:/xdmod-supremm
docker cp ~/xdmod playwright:/xdmod
docker cp ~/project playwright:/xdmod-supremm
- run:
name: Install SUPREMM Dependencies
name: Mark the XDMoD directories as safe for git
command: |
composer install --no-progress
docker exec -w /xdmod xdmod git config --global --add safe.directory /xdmod
docker exec -w /xdmod-supremm xdmod git config --global --add safe.directory /xdmod-supremm
- run:
name: Install XDMoD Dependencies
name: Install Dependencies for xdmod and xdmod-supremm
command: |
composer config -g cache-files-ttl 315360000
composer install -d $XDMOD_SRC_DIR --no-progress
docker exec -w /xdmod xdmod composer config -g cache-files-ttl 315360000
docker exec -w /xdmod xdmod composer install
docker exec -w /xdmod-supremm xdmod composer install
- run:
name: Create Test Artifact Directories
name: Link the Supremm Module into XDMoD's directory structure
command: |
mkdir -p ~/phpunit
mkdir -p /tmp/screenshots
docker exec -w /xdmod-supremm xdmod ln -s /xdmod-supremm /xdmod/open_xdmod/modules/supremm
docker exec -w /xdmod-supremm playwright ln -s /xdmod-supremm /xdmod/open_xdmod/modules/supremm
- run:
name: Setup Environment Variables
command: |
echo "export XDMOD_SOURCE_DIR=${CIRCLE_WORKING_DIRECTORY}/${XDMOD_SRC_DIR}" >> $BASH_ENV
echo "export SHIPPABLE_BUILD_DIR=${CIRCLE_WORKING_DIRECTORY}" >> $BASH_ENV
name: Generate Key for XDMoD
command: docker exec xdmod openssl genrsa -out /etc/pki/tls/private/localhost.key -rand /proc/cpuinfo:/proc/filesystems:/proc/interrupts:/proc/ioports:/proc/uptime 2048
- run:
name: Generate Cert for XDMoD
command: docker exec xdmod /usr/bin/openssl req -new -key /etc/pki/tls/private/localhost.key -x509 -sha256 -days 365 -set_serial $RANDOM -extensions v3_req -out /etc/pki/tls/certs/localhost.crt -subj "/C=XX/L=Default City/O=Default Company Ltd"
- run:
name: Build RPMS
name: Create Test Artifact Directories in the XDMoD Container
command: |
pushd $XDMOD_SRC_DIR
~/bin/buildrpm xdmod supremm
popd
docker exec xdmod mkdir -p /tmp/phpunit
docker exec xdmod mkdir -p /tmp/screenshots
- run:
name: Build RPMs on XDMoD
command: docker exec -w /xdmod xdmod /root/bin/buildrpm xdmod supremm
- run:
name: Install / Upgrade XDMoD from RPM
command: |
./tests/integration/scripts/bootstrap.sh
docker exec -e XDMOD_TEST_MODE=<< parameters.install-type >> xdmod /xdmod/open_xdmod/modules/supremm/tests/integration/scripts/bootstrap.sh
- run:
name: Validate the newly installed / Upgraded XDMoD
command: ./tests/integration/scripts/validate.sh
- run:
name: Make sure that the Composer Test Dependencies are installed
command: |
composer install -d $XDMOD_SRC_DIR --no-progress
composer install --no-progress
command: docker exec -w /xdmod-supremm xdmod ./tests/integration/scripts/validate.sh
- run:
name: Setup & Run QA Tests
command: ./tests/ci/scripts/qa-test-setup.sh
- run:
name: Updating XDMOD_INSTALL_DIR env variable
command: echo "export XDMOD_INSTALL_DIR=/usr/share/xdmod" >> $BASH_ENV
command: docker exec -w /xdmod-supremm xdmod ./tests/ci/scripts/qa-test-setup.sh
- run:
name: Run Post Install Tests
command: ./tests/ci/scripts/post-install-test.sh
command: docker exec -w /xdmod-supremm xdmod ./tests/ci/scripts/post-install-test.sh
- run:
name: Install composer dev deps
command: |
docker exec -w /xdmod xdmod composer install
docker exec -w /xdmod-supremm xdmod composer install
- run:
name: Run Component Tests
command: ./tests/component/runtests.sh --log-junit ~/phpunit/component.xml
command: docker exec -w /xdmod-supremm xdmod ./tests/component/runtests.sh --log-junit ~/phpunit
- run:
name: Make sure that the Composer Test Dependencies are installed
name: Setup Configuration Files for Integration Tests
command: |
composer install -d $XDMOD_SRC_DIR --no-progress
docker exec xdmod mv /xdmod/configuration/organization.json /xdmod/configuration/organization.json.old
docker exec xdmod mv /xdmod/configuration/portal_settings.ini /xdmod/configuration/portal_settings.ini.old
docker exec xdmod cp /etc/xdmod/portal_settings.ini /xdmod/configuration/portal_settings.ini
docker exec xdmod cp /etc/xdmod/organization.json /xdmod/configuration/organization.json
- run:
name: Run Integration Tests
command: ./tests/integration/runtests.sh --log-junit ~/phpunit/integration.xml
command: docker exec -w /xdmod-supremm xdmod ./tests/integration/runtests.sh --log-junit ~/phpunit
- run:
name: 'Install Chromium 99'
command: |
pushd $HOME && \
rm -rf chrome-linux && \
wget -O chrome-linux.zip "https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F961656%2Fchrome-linux.zip?generation=1642723767466615&alt=media" && \
unzip chrome-linux.zip && \
ln -s /root/chrome-linux/chrome /usr/local/bin/google-chrome && \
popd
- run:
name: 'Bodge the nodejs version to run an older one for the webdriver tests'
command: |
curl https://nodejs.org/dist/v10.24.1/node-v10.24.1-linux-x64.tar.xz | tar -xJC /usr/local
chown root:root -R /usr/local/node-v10.24.1-linux-x64
- run: pushd $XDMOD_SRC_DIR/tests/ui && PATH=/usr/local/node-v10.24.1-linux-x64/bin:$PATH /usr/local/node-v10.24.1-linux-x64/bin/npm install && popd
name: Update the HTTPD config file
command: docker exec xdmod sed -i 's/ServerName localhost/ServerName xdmod/g' /etc/httpd/conf.d/xdmod.conf
- run:
name: Run UI Tests
command: "PATH=/usr/local/node-v10.24.1-linux-x64/bin:$PATH $XDMOD_SRC_DIR/tests/ui/runtests.sh --headless --log-junit ~/phpunit"
name: Restart XDMoD's services
command: docker exec xdmod /root/bin/services restart
- run:
name: Ensure that no unexpected Apache errors were generated
command: |
if [ -e /var/log/php-fpm/www-error.log ]; then
test `egrep -v "PHP Deprecated.*\/vendor\/.*" /var/log/php-fpm/www-error.log | wc -l` = 0;
fi
name: Run Job Performance Playwright Tests
command: docker exec -w /xdmod/tests/playwright playwright /xdmod/open_xdmod/modules/supremm/tests/playwright/runtests.sh -j << parameters.os >>
- run:
name: Run Regression Tests
command: ./tests/regression/runtests.sh --junit-output-dir ~/phpunit
command: docker exec -w /xdmod xdmod ./tests/regression_tests/runtests.sh --log-junit ~/phpunit
- run:
name: Ensure that no PHP command-line errors were generated
command: >
if [ -e /var/log/php_errors.log ]; then
test `egrep -v 'vendor/phpunit/phpunit/src|PHP Notice: fread()' /var/log/php_errors.log | wc -l` = 0;
fi
name: Ensure that no unexpected Apache errors were generated
command: docker exec xdmod test `fgrep -v ' [ssl:warn] ' /var/log/xdmod/apache-error.log | wc -l` = 0
- run:
name: Ensure that no unexpected Apache errors were generated
command: docker exec xdmod test ! -e /var/log/php-fpm/www-error.log
- run:
name: Copy Test Results into Unit
command: |
docker cp xdmod:/root/phpunit ~/phpunit
docker cp xdmod:/tmp/screenshots /tmp/screenshots
mkdir ~/project/log
docker cp xdmod:/var/log/xdmod ~/project/log
docker cp xdmod:/var/log/php-fpm/ ~/project/log
docker cp playwright:/xdmod/tests/playwright/test_results-<< parameters.os >>.xml ~/phpunit
docker cp playwright:/xdmod/tests/playwright/test-results /tmp/screenshots
- store_artifacts:
path: /tmp/screenshots
- store_artifacts:
Expand All @@ -136,13 +136,13 @@ jobs:
- store_artifacts:
path: /var/log/php_errors.log
- store_test_results:
path: ~/phpunit
path: /tmp/phpunit

workflows:
full-build:
jobs:
- build:
matrix:
parameters:
os: [rocky8]
install-type: ["fresh_install", "upgrade"]
os: ['rocky8']
install-type: ['fresh_install', 'upgrade']
37 changes: 37 additions & 0 deletions tests/playwright/Docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
services:
xdmod:
image: tools-ext-01.ccr.xdmod.org/xdmod-job-performance:x86_64-rockylinux8.9.20231119-v11.0.0-1.0-04
init: true
container_name: xdmod
hostname: xdmod
networks:
- testing
shm_size: 2g
ports:
- 8080:443
- 7000:7000
environment:
XDMOD_REALMS: 'jobs,storage,cloud,resourcespecifications,supremm'
XDMOD_IS_CORE: true
XDMOD_INSTALL_DIR: '/usr/share/xdmod'
XDMOD_ETC_DIR: '/etc/xdmod'
command: sleep infinity
playwright:
image: mcr.microsoft.com/playwright:v1.51.1-jammy
hostname: playwright
container_name: playwright
networks:
- testing
stdin_open: true
tty: true
ipc: host
links:
- xdmod
depends_on:
- xdmod
environment:
BASE_URL: https://xdmod
XDMOD_REALMS: 'jobs,storage,cloud,resourcespecifications,supremm'
command: sleep infinity
networks:
testing:
17 changes: 17 additions & 0 deletions tests/playwright/Docker/playwright/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM mcr.microsoft.com/playwright:v1.51.0-jammy

ENV GIT_BRANCH=${GIT_BRANCH:-playwright_poc}
ENV GIT_USER=${GIT_USER:-ubccr}
ENV XDMOD_SOURCE_DIR=${XDMOD_SOURCE_DIR:-/xdmod}
ENV XDMOD_REALMS=${XDMOD_REALMS:-jobs,cloud,storage}
ENV BASE_URL=${BASE_URL:-https://xdmod}

RUN apt update
RUN apt install -y iputils-ping vim procps
COPY bin /root/bin
RUN git clone --branch=$GIT_BRANCH --depth=1 https://github.com/$GIT_USER/xdmod.git $XDMOD_SOURCE_DIR
RUN npm upgrade -g npm -y
WORKDIR $XDMOD_SOURCE_DIR/tests/playwright
RUN npm install
RUN npx playwright install --with-deps chromium
ENTRYPOINT /root/bin/entrypoint.sh
4 changes: 4 additions & 0 deletions tests/playwright/Docker/playwright/bin/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

trap : TERM INT
tail -f /dev/null & wait
6 changes: 6 additions & 0 deletions tests/playwright/Docker/xdmod/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM tools-int-01.ccr.xmdod.org/xdmod-job_performance-x86_64:v10.5.0-1.0

COPY bin /root/bin

ENTRYPOINT /root/bin/entrypoint.sh

4 changes: 4 additions & 0 deletions tests/playwright/Docker/xdmod/bin/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
trap : TERM INT
tail -f /dev/null & wait

26 changes: 26 additions & 0 deletions tests/playwright/lib/base.page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import {expect, Locator, Page} from "@playwright/test";

export class BasePage {
readonly page: Page;
readonly maskSelector: string;
readonly mask: Locator;
readonly baseUrl: string;

constructor(page: Page, baseUrl: string) {
this.page = page;
this.maskSelector = '.ext-el-mask-msg';
this.mask = page.locator(this.maskSelector);
this.baseUrl = baseUrl;
}

public async verifyLocation(url: string, expectedTitle: string) {
const newUrl = new URL(url, this.baseUrl);
try{
await this.page.goto(newUrl.toString());
}catch(error){
throw new Error(error);
}
const title = await this.page.title();
expect(title).toEqual(expectedTitle);
}
}
9 changes: 9 additions & 0 deletions tests/playwright/lib/base.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { test as base } from '@playwright/test';

export type TestOptions = {
role: string;
}

export const test = base.extend<TestOptions>({
role: null
});
Loading