Skip to content

Update circleci config #2022

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

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
59 changes: 33 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
executor: << parameters.os >>
environment:
COMPOSER_ALLOW_SUPERUSER: 1
COMPOSER_ALLOW_XDEBUG: 1
COMPOSER_DISABLE_XDEBUG_WARN: 1
XDMOD_REALMS: 'jobs,storage,cloud,resourcespecifications'
QA_BRANCH: 'v2'
TRAVIS_COMMIT_RANGE: << pipeline.git.base_revision >>..<<pipeline.git.revision>>
Expand Down Expand Up @@ -65,15 +67,31 @@ jobs:
- run:
name: Build XDMoD RPM
command: docker exec -w /root/xdmod xdmod /root/bin/buildrpm xdmod

# This when condition will only trigger if the build is being run by:
# - a scheduled pipline ( cron job ) called "xdmod-time-trigger"
# OR
# - if the build has the "schedule-name" parameter set to "xdmod-time-trigger"
# This is so that we can manually trigger code coverage generation for testing purposes.
- when:
condition:
or:
- and:
- equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can you add some documentation to explain how to trigger code coverage capture (this could be a readme or just comments in this file)

- equal: [ "xdmod-time-trigger", << pipeline.schedule.name >> ]
- or:
- equal: [ "xdmod-time-trigger", << parameters.schedule-name >> ]
steps:
- run:
name: Installing Code Coverage Dependencies
command: |
docker exec -w /root/xdmod xdmod /root/xdmod/tools/dev/code_coverage/codeCoverageSetup.sh -b . -x /root/xdmod/tools/dev/code_coverage/start_xdebug.php -p /root/xdmod/tools/dev/code_coverage/combine_xdebug.php
- run:
name: Install / Upgrade XDMoD from the newly created RPM
command: docker exec -e XDMOD_TEST_MODE=<< parameters.install-type >> xdmod /root/xdmod/tests/ci/bootstrap.sh
- run:
name: Validate that the install / upgrade went as expected
command: docker exec -w /root/xdmod xdmod /root/xdmod/tests/ci/validate.sh
- run:
name: Make sure that the test dependencies are installed
command: docker exec -w /root/xdmod xdmod composer install
- run:
name: Setup the SimpleSAML server etc. so we can test SSO
command: docker exec xdmod /root/xdmod/tests/ci/samlSetup.sh
Expand Down Expand Up @@ -101,21 +119,6 @@ jobs:
- run:
name: Run QA Tests
command: docker exec -w /root/xdmod xdmod /root/.qa/scripts/build.sh
- run:
name: Make sure that the Test Dependencies are installed
command: docker exec -w /root/xdmod xdmod composer install --no-progress
- when:
condition:
and:
- equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
- equal: [ "xdmod-time-trigger", << pipeline.schedule.name >> ]

steps:
- run:
name: Installing Code Coverage Dependencies
command: |
docker exec -w /root/xdmod xdmod /root/xdmod/tools/dev/code_coverage/codeCoverageSetup.sh -b . -x /root/xdmod/tools/dev/code_coverage/start_xdebug.php -p /root/xdmod/tools/dev/code_coverage/combine_xdebug.php

- run:
name: Run Regression Tests
command: docker exec -e XDMOD_TEST_MODE=<< parameters.install-type >> -w /root/xdmod xdmod /root/xdmod/tests/regression/runtests.sh
Expand Down Expand Up @@ -147,9 +150,12 @@ jobs:
command: docker exec -w /root/xdmod/tests/playwright playwright /root/xdmod/tests/playwright/runtests.sh -j << parameters.string_os >>
- when:
condition:
and:
- equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
- equal: [ "xdmod-time-trigger", << pipeline.schedule.name >> ]
or:
- and:
- equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
- equal: [ "xdmod-time-trigger", << pipeline.schedule.name >> ]
- or:
- equal: [ "xdmod-time-trigger", << parameters.schedule-name >> ]
steps:
- run:
name: Process Code Coverage Data
Expand Down Expand Up @@ -211,11 +217,12 @@ jobs:
path: ~/phpunit
- when:
condition:
and:
- equal: ["xdmod-time-trigger", << parameters.schedule-name >>]
# and:
# - equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
# - equal: [ "xdmod-time-trigger", << pipeline.schedule.name >> ]
or:
- and:
- equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
- equal: [ "xdmod-time-trigger", << pipeline.schedule.name >> ]
- or:
- equal: [ "xdmod-time-trigger", << parameters.schedule-name >> ]
steps:
- store_artifacts:
path: ~/code_coverage
Expand Down
2 changes: 2 additions & 0 deletions tests/playwright/Docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ services:
environment:
XDMOD_REALMS: 'jobs,storage,cloud,resourcespecifications'
XDMOD_IS_CORE: true
COMPOSER_ALLOW_XDEBUG: 1
COMPOSER_DISABLE_XDEBUG_WARN: 1
stdin_open: true
tty: true
command: sleep infinity
Expand Down
8 changes: 1 addition & 7 deletions tools/dev/code_coverage/codeCoverageSetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ fi
OS_VERSION=$(cat /etc/os-release | grep "VERSION_ID" | cut -d'=' -f 2 | tr -d '"')
XDEBUG_VERSION=3.1.6
### Install Pre-Reqs
yum -y install php-devel php-pear gcc gcc-c++ autoconf automake
yum -y install php-devel

### Install xdebug
pecl install Xdebug-"$XDEBUG_VERSION"
Expand Down Expand Up @@ -500,13 +500,7 @@ echo ${arg_r}
echo
echo $PROCESS_FILE_INSTALL_PATH

~/bin/services restart

### Create / Update privs for the directory that will contain the code coverage reports.
mkdir "${arg_c}"
chmod 777 "${arg_c}"
chown root:apache "${arg_c}"

### Make sure to restart the services so that these changes take effect.x
#~/bin/services stop
#~/bin/services start