Skip to content

Commit

Permalink
#27059: including fabric8.io maven docker plugin to run postman tests
Browse files Browse the repository at this point in the history
  • Loading branch information
victoralfaro-dotcms committed Jan 25, 2024
1 parent 110141b commit 9efff3c
Show file tree
Hide file tree
Showing 8 changed files with 205 additions and 96 deletions.
37 changes: 23 additions & 14 deletions .github/actions/resolve-postman-collections/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,13 @@ inputs:
default: |
[
{
"name": "graphql",
"collections": ["GraphQLTests"]
},
{
"name": "workflow",
"collections": ["Workflow_Resource_Tests"]
},
{
"name": "template",
"collections": ["Template_Resource.postman_collection"]
},
{
"name": "page",
"collections": ["PagesResourceTests"]
"name": "category-content",
"collections": [
"Category.postman_collection.json",
"ContentResourceV1.postman_collection.json",
"ContentTypeResourceTests.json",
"Content_Resource.postman_collection.json"
]
},
{
"name": "container",
Expand All @@ -36,6 +29,14 @@ inputs:
"name": "experiment",
"collections": ["Experiments_Resource.postman_collection", "Experiment_Result.postman_collection"]
},
{
"name": "graphql",
"collections": ["GraphQLTests"]
},
{
"name": "page",
"collections": ["PagesResourceTests"]
},
{
"name": "pp",
"collections": [
Expand All @@ -44,6 +45,14 @@ inputs:
"Push_Publish_JWT_Token_Test.postman_collection",
"PushPublishFilterResource.postman_collection"
]
},
{
"name": "template",
"collections": ["Template_Resource.postman_collection"]
},
{
"name": "workflow",
"collections": ["Workflow_Resource_Tests"]
}
]
current:
Expand Down
34 changes: 21 additions & 13 deletions .github/workflows/maven-cicd-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: true
env:
JVM_TEST_MAVEN_OPTS: "-e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
JVM_TEST_MAVEN_OPTS: "-e -B --no-transfer-progress -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
DOCKER_PLATFORMS: "linux/amd64,linux/arm64"
REGISTRY: ghcr.io
IMAGE_NAME: dotcms/dotcms_test
Expand Down Expand Up @@ -187,7 +187,6 @@ jobs:
- name: Setup Context
id: setup-docker-context
run: |
mkdir -p $DOCKER_BUILD_CONTEXT/context
tar -xvf $DOCKER_BUILD_CONTEXT/docker-build.tar -C $DOCKER_BUILD_CONTEXT/context
- name: Build base image
Expand Down Expand Up @@ -407,7 +406,7 @@ jobs:
shell: bash
env:
NODE_CACHE_HIT: ${{ steps.cache-node-modules.outputs.cache-hit }}
run: eval ./mvnw -Dprod $JVM_TEST_MAVEN_OPTS -Dskip.npm.install=${NODE_CACHE_HIT} $JVM_TEST_MAVEN_OPTS -pl :dotcms-core-web test
run: eval ./mvnw -Dprod -Dskip.npm.install=${NODE_CACHE_HIT} $JVM_TEST_MAVEN_OPTS -pl :dotcms-core-web test
- name: Prepare failure archive (if maven failed)
if: failure()
shell: bash
Expand Down Expand Up @@ -533,12 +532,12 @@ jobs:
strategy:
fail-fast: false
matrix:
collection_group: [ 'graphql', 'workflow', 'template', 'page', 'container', 'pp', 'experiment', 'default' ]
collection_group: [ 'category-container', 'content', 'experiment', 'graphql', 'page', 'pp', 'template', 'workflow', 'default' ]
steps:
- id: fetch-core
name: Fetch Core Repo
uses: actions/checkout@v3
- run: sudo npm install --location=global [email protected]
- run: sudo npm install --location=global [email protected] [email protected]
- id: docker-login
name: Login to GHCR
uses: docker/[email protected]
Expand All @@ -551,22 +550,31 @@ jobs:
with:
current: ${{ matrix.collection_group }}
- name: Prepare license
id: prepare-license
run: |
mkdir -p dotcms-postman/license
touch dotcms-postman/license/license.dat
echo "${{ secrets.DOTCMS_LICENSE }}" > dotcms-postman/license/license.dat
chmod 777 dotcms-postman/license/license.dat
postman_dir=${{ github.workspace }}/dotcms-postman
docker_volumes_dir=${postman_dir}/target/docker-volumes
[[ -d ${docker_volumes_dir} ]] && rm -rf ${docker_volumes_dir}
dotcms_volumes_dir=${docker_volumes_dir}/dotcms
license_dir=${dotcms_volumes_dir}/license
mkdir -p ${license_dir}
license_file=${license_dir}/license.dat
touch ${license_file}
echo "${{ secrets.DOTCMS_LICENSE }}" > ${license_file}
chmod -R 777 ${license_dir}
- id: run-postman-tests
name: Run Postman Tests
timeout-minutes: 90
run: |
./mvnw $JVM_TEST_MAVEN_OPTS verify \
./mvnw -Dpostman-tests -Dprod $JVM_TEST_MAVEN_OPTS verify \
-pl :dotcms-postman \
-Dpostman.collections=\"${{ steps.resolve-postman-collections.outputs.collections_to_run }}\"
-Dpostman.collections="${{ steps.resolve-postman-collections.outputs.collections_to_run }}"
pec=$?
[[ pec -eq 0 ]] || exit pec
env:
JVM_TEST_MAVEN_OPTS: "-e -B"
DOTCMS_IMAGE: ${{ needs.build-jdk11.outputs.docker-tag }}
- name: Prepare reports archive (if maven failed)
if: failure()
Expand All @@ -587,7 +595,7 @@ jobs:
with:
name: "build-reports-test-postman - ${{ matrix.collection_group }}"
path: |
**/target/*-reports/TEST-*.xml
**/dotcms-postman/target/postman-reports/TEST-*.xml
target/build-report.json
LICENSE
retention-days: 2
Expand Down
14 changes: 8 additions & 6 deletions dotCMS/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ dependencies {
implementation (group: 'com.h2database', name: 'h2', version: '2.1.214'){}
implementation (group: 'com.impossibl.pgjdbc-ng', name: 'pgjdbc-ng', version: '0.8.9'){}
implementation (group: 'com.impossibl.pgjdbc-ng', name: 'spy', version: '0.8.9'){}
implementation (group: 'com.jayway.jsonpath', name: 'json-path', version: '2.4.0'){}
implementation (group: 'com.jayway.jsonpath', name: 'json-path', version: '2.4.0') {
exclude group: 'net.minidev', module: 'json-smart'
}
implementation (group: 'com.lmax', name: 'disruptor', version: '3.3.4'){}
implementation (group: 'com.maxmind.db', name: 'maxmind-db', version: '1.0.0'){}
implementation (group: 'com.maxmind.geoip2', name: 'geoip2', version: '2.1.0'){}
Expand All @@ -159,7 +161,7 @@ dependencies {
implementation (group: 'com.tdunning', name: 't-digest', version: '3.2') {
transitive=false
}
implementation (group: 'com.thoughtworks.xstream', name: 'xstream', version: '1.4.17') {
implementation (group: 'com.thoughtworks.xstream', name: 'xstream', version: '1.4.20') {
exclude group: 'xpp3', module: 'xpp3_min'
}
testImplementation (group: 'com.tngtech.junit.dataprovider', name: 'junit-dataprovider-core', version: '2.6'){}
Expand Down Expand Up @@ -206,7 +208,7 @@ dependencies {
}
implementation (group: 'fop', name: 'fop', version: '0.20.3'){}
implementation (group: 'io.github.classgraph', name: 'classgraph', version: '4.8.138'){}
implementation (group: 'io.github.x-stream', name: 'mxparser', version: '1.2.1'){}
implementation (group: 'io.github.x-stream', name: 'mxparser', version: '1.2.2'){}
implementation (group: 'io.jsonwebtoken', name: 'jjwt', version: '0.9.1'){}
implementation (group: 'io.lettuce', name: 'lettuce-core', version: '6.1.1.RELEASE'){}
implementation (group: 'io.netty', name: 'netty-buffer', version: '4.1.63.Final'){}
Expand Down Expand Up @@ -246,8 +248,8 @@ dependencies {
implementation (group: 'net.javacrumbs.shedlock', name: 'shedlock-provider-jdbc-internal', version: '4.33.0'){}
implementation (group: 'net.javacrumbs.shedlock', name: 'shedlock-provider-jdbc', version: '4.33.0'){}
implementation (group: 'net.jodah', name: 'failsafe', version: '1.1.1'){}
implementation (group: 'net.minidev', name: 'accessors-smart', version: '1.2'){}
implementation (group: 'net.minidev', name: 'json-smart', version: '2.3'){}
implementation (group: 'net.minidev', name: 'accessors-smart', version: '2.4.9'){}
implementation (group: 'net.minidev', name: 'json-smart', version: '2.4.9'){}
implementation (group: 'net.sf.jopt-simple', name: 'jopt-simple', version: '5.0.2') {
transitive=false
}
Expand Down Expand Up @@ -426,7 +428,7 @@ dependencies {
implementation (group: 'org.jvnet.mimepull', name: 'mimepull', version: '1.9.6'){}
testImplementation (group: 'org.mockito', name: 'mockito-core', version: '2.28.2'){}
testImplementation (group: 'org.objenesis', name: 'objenesis', version: '2.5.1'){}
implementation (group: 'org.ow2.asm', name: 'asm', version: '5.0.4'){}
implementation (group: 'org.ow2.asm', name: 'asm', version: '9.3'){}
compileOnly (group: 'org.postgresql', name: 'postgresql', version: '42.5.1') {
exclude group: 'org.checkerframework', module: 'checker-qual'
}
Expand Down
Loading

0 comments on commit 9efff3c

Please sign in to comment.