@eeacms/volto-n2k 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,11 +4,12 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
- ### [0.1.12](https://github.com/eea/volto-n2k/compare/0.1.11...0.1.12) - 30 September 2022
7
+ ### [0.1.13](https://github.com/eea/volto-n2k/compare/0.1.12...0.1.13) - 30 September 2022
8
8
 
9
- #### :rocket: New Features
9
+ #### :hammer_and_wrench: Others
10
10
 
11
- - feat: Set font size to 16px on N2K [Miu Razvan - [`b11e184`](https://github.com/eea/volto-n2k/commit/b11e1840689232b778f9421e94369d0de64134ce)]
11
+ - Rerun cypress [Miu Razvan - [`37b91e4`](https://github.com/eea/volto-n2k/commit/37b91e409a18b200e7b480e3d36c2f93c12e4fe5)]
12
+ ### [0.1.12](https://github.com/eea/volto-n2k/compare/0.1.11...0.1.12) - 30 September 2022
12
13
 
13
14
  #### :hammer_and_wrench: Others
14
15
 
package/Jenkinsfile CHANGED
@@ -108,62 +108,62 @@ pipeline {
108
108
  }
109
109
  }
110
110
 
111
- // stage('Integration tests') {
112
- // when {
113
- // allOf {
114
- // environment name: 'CHANGE_ID', value: ''
115
- // anyOf {
116
- // not { changelog '.*^Automated release [0-9\\.]+$' }
117
- // branch 'master'
118
- // }
119
- // }
120
- // }
121
- // steps {
122
- // parallel(
123
-
124
- // "Cypress": {
125
- // node(label: 'docker') {
126
- // script {
127
- // try {
128
- // sh '''docker pull eeacms/plone-backend; docker run -d --rm --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="eea.kitkat:testing" eeacms/plone-backend'''
129
- // sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" -e NODE_ENV=development -e VOLTO="$VOLTO" plone/volto-addon-ci cypress'''
130
- // } finally {
131
- // try {
132
- // sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
133
- // sh '''mkdir -p cypress-reports cypress-results cypress-coverage'''
134
- // sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/videos cypress-reports/'''
135
- // sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
136
- // coverage = sh script: '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/coverage cypress-coverage/''', returnStatus: true
137
- // if ( coverage == 0 ) {
138
- // publishHTML (target : [allowMissing: false,
139
- // alwaysLinkToLastBuild: true,
140
- // keepAll: true,
141
- // reportDir: 'cypress-coverage/coverage/lcov-report',
142
- // reportFiles: 'index.html',
143
- // reportName: 'CypressCoverage',
144
- // reportTitles: 'Integration Tests Code Coverage'])
145
- // }
146
- // sh '''touch empty_file; for ok_test in $(grep -E 'file=.*failures="0"' $(grep 'testsuites .*failures="0"' $(find cypress-results -name *.xml) empty_file | awk -F: '{print $1}') empty_file | sed 's/.* file="\\(.*\\)" time.*/\\1/' | sed 's#^cypress/integration/##g' | sed 's#^../../../node_modules/@eeacms/##g'); do rm -f cypress-reports/videos/$ok_test.mp4; rm -f cypress-reports/$ok_test.mp4; done'''
147
- // archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true
148
- // stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
149
- // }
150
- // finally {
151
- // catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
152
- // junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
153
- // }
154
- // sh script: "docker stop $BUILD_TAG-plone", returnStatus: true
155
- // sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true
156
- // sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true
157
-
158
- // }
159
- // }
160
- // }
161
- // }
162
- // }
163
-
164
- // )
165
- // }
166
- // }
111
+ stage('Integration tests') {
112
+ when {
113
+ allOf {
114
+ environment name: 'CHANGE_ID', value: ''
115
+ anyOf {
116
+ not { changelog '.*^Automated release [0-9\\.]+$' }
117
+ branch 'master'
118
+ }
119
+ }
120
+ }
121
+ steps {
122
+ parallel(
123
+
124
+ "Cypress": {
125
+ node(label: 'docker') {
126
+ script {
127
+ try {
128
+ sh '''docker pull eeacms/plone-backend; docker run -d --rm --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="eea.kitkat:testing" eeacms/plone-backend'''
129
+ sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" -e NODE_ENV=development -e VOLTO="$VOLTO" plone/volto-addon-ci cypress'''
130
+ } finally {
131
+ try {
132
+ sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
133
+ sh '''mkdir -p cypress-reports cypress-results cypress-coverage'''
134
+ sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/videos cypress-reports/'''
135
+ sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
136
+ coverage = sh script: '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/coverage cypress-coverage/''', returnStatus: true
137
+ if ( coverage == 0 ) {
138
+ publishHTML (target : [allowMissing: false,
139
+ alwaysLinkToLastBuild: true,
140
+ keepAll: true,
141
+ reportDir: 'cypress-coverage/coverage/lcov-report',
142
+ reportFiles: 'index.html',
143
+ reportName: 'CypressCoverage',
144
+ reportTitles: 'Integration Tests Code Coverage'])
145
+ }
146
+ sh '''touch empty_file; for ok_test in $(grep -E 'file=.*failures="0"' $(grep 'testsuites .*failures="0"' $(find cypress-results -name *.xml) empty_file | awk -F: '{print $1}') empty_file | sed 's/.* file="\\(.*\\)" time.*/\\1/' | sed 's#^cypress/integration/##g' | sed 's#^../../../node_modules/@eeacms/##g'); do rm -f cypress-reports/videos/$ok_test.mp4; rm -f cypress-reports/$ok_test.mp4; done'''
147
+ archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true
148
+ stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
149
+ }
150
+ finally {
151
+ catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
152
+ junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
153
+ }
154
+ sh script: "docker stop $BUILD_TAG-plone", returnStatus: true
155
+ sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true
156
+ sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true
157
+
158
+ }
159
+ }
160
+ }
161
+ }
162
+ }
163
+
164
+ )
165
+ }
166
+ }
167
167
 
168
168
  stage('Report to SonarQube') {
169
169
  when {
@@ -183,12 +183,12 @@ pipeline {
183
183
  script{
184
184
  checkout scm
185
185
  unstash "xunit-reports"
186
- // unstash "cypress-coverage"
186
+ unstash "cypress-coverage"
187
187
  def scannerHome = tool 'SonarQubeScanner';
188
188
  def nodeJS = tool 'NodeJS';
189
189
  withSonarQubeEnv('Sonarqube') {
190
190
  sh '''sed -i "s#/opt/frontend/my-volto-project/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
191
- // sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
191
+ sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
192
192
  sh '''try=2; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 60; try=\$(( \$try - 1 )); fi; done'''
193
193
  }
194
194
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-n2k",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "volto-n2k: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -39,6 +39,7 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@cypress/code-coverage": "^3.9.5",
42
+ "md5": "^2.3.0",
42
43
  "babel-plugin-transform-class-properties": "^6.24.1"
43
44
  },
44
45
  "scripts": {