Skip to content

Commit

Permalink
Merge branch 'release-2.14.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Luis Gutierrez Dos Santos committed Jun 19, 2020
2 parents 0dff3c6 + 45fa5b1 commit abeda7d
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 3 deletions.
151 changes: 151 additions & 0 deletions .Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
pipeline {
agent {
label 'builder'
}
stages {
stage('Resolve TAO dependencies') {
environment {
GITHUB_ORGANIZATION='oat-sa'
REPO_NAME='oat-sa/extension-tao-testqti-previewer'
}
steps {
sh(
label : 'Create build build directory',
script: 'mkdir -p build'
)

withCredentials([string(credentialsId: 'jenkins_github_token', variable: 'GIT_TOKEN')]) {
sh(
label : 'Run the Dependency Resolver',
script: '''
changeBranch=$CHANGE_BRANCH
TEST_BRANCH="${changeBranch:-$BRANCH_NAME}"
echo "select branch : ${TEST_BRANCH}"
docker run --rm \\
-e "GITHUB_ORGANIZATION=${GITHUB_ORGANIZATION}" \\
-e "GITHUB_SECRET=${GIT_TOKEN}" \\
tao/dependency-resolver oat:dependencies:resolve --main-branch ${TEST_BRANCH} --repository-name ${REPO_NAME} > build/dependencies.json

cat > build/composer.json <<- composerjson
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/${REPO_NAME}",
"no-api": true
}
],
composerjson
tail -n +2 build/dependencies.json >> build/composer.json
'''
)
sh(
label: 'composer.json',
script: 'cat build/composer.json'
)
}
}
}
stage('Install') {
agent {
docker {
image 'alexwijn/docker-git-php-composer'
args "-v $BUILDER_CACHE_DIR/composer:/tmp/.composer-cache -e COMPOSER_CACHE_DIR=/tmp/.composer-cache"
reuseNode true
}
}
environment {
HOME = '.'
}
options {
skipDefaultCheckout()
}
steps {
dir('build') {
sh(
label: 'Install/Update sources from Composer',
script: 'COMPOSER_DISCARD_CHANGES=true composer install --prefer-dist --no-interaction --no-ansi --no-progress --no-suggest'
)
sh(
label: 'Add phpunit',
script: 'composer require phpunit/phpunit:^8.5 --no-progress'
)
sh(
label: "Extra filesystem mocks",
script: '''
mkdir -p taoQtiItem/views/js/mathjax/ && touch taoQtiItem/views/js/mathjax/MathJax.js
mkdir -p tao/views/locales/en-US/
echo "{\\"serial\\":\\"${BUILD_ID}\\",\\"date\\":$(date +%s),\\"version\\":\\"3.3.0-${BUILD_NUMBER}\\",\\"translations\\":{}}" > tao/views/locales/en-US/messages.json
mkdir -p tao/views/locales/en-US/
'''
)
}
}
}
stage('Tests') {
parallel {
stage('Backend Tests') {
when {
expression {
fileExists('build/taoQtiTestPreviewer/test/unit')
}
}
agent {
docker {
image 'alexwijn/docker-git-php-composer'
reuseNode true
}
}
options {
skipDefaultCheckout()
}
steps {
dir('build'){
sh(
label: 'Run backend tests',
script: './vendor/bin/phpunit taoQtiTestPreviewer/test/unit'
)
}
}
}
stage('Frontend Tests') {
when {
expression {
fileExists('build/taoQtiTestPreviewer/views/build/grunt/test.js')
}
}
agent {
docker {
image 'btamas/puppeteer-git'
args "-v $BUILDER_CACHE_DIR/npm:/tmp/.npm-cache -e npm_config_cache=/tmp/.npm-cache"
reuseNode true
}
}
environment {
HOME = '.'
}
options {
skipDefaultCheckout()
}
steps {
dir('build/tao/views/build') {
sh(
label: 'Install tao-core frontend extensions',
script: 'npm install'
)
sh (
label : 'Run frontend tests',
script: 'npx grunt connect:test taoqtitestpreviewertest'
)
}
}
}
}
}
}
post {
always {
cleanWs disableDeferredWipeout: true
}
}
}
2 changes: 1 addition & 1 deletion manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
'label' => 'extension-tao-testqti-previewer',
'description' => 'extension that provides QTI test previewer',
'license' => 'GPL-2.0',
'version' => '2.13.0',
'version' => '2.14.1',
'author' => 'Open Assessment Technologies SA',
'requires' => [
'generis' => '>=12.15.0',
Expand Down
2 changes: 1 addition & 1 deletion scripts/update/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ public function update($initialVersion)
$this->setVersion('0.2.0');
}

$this->skip('0.2.0', '2.13.0');
$this->skip('0.2.0', '2.14.1');
}
}
2 changes: 1 addition & 1 deletion views/js/loader/qtiPreviewer.min.js.map

Large diffs are not rendered by default.

0 comments on commit abeda7d

Please sign in to comment.