diff --git a/Jenkinsfile b/Jenkinsfile index 0cc8bae..f53149e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -131,10 +131,20 @@ pipeline { "PloneSaaS": { node(label: 'docker') { - sh '''docker pull eeacms/plonesaas-devel;docker run -i --rm --name="$BUILD_TAG-plonesaas" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plonesaas-devel /debug.sh bin/test --test-path /plone/instance/src/$GIT_NAME -v -vv -s $GIT_NAME''' + script { + try { + sh '''docker pull eeacms/plonesaas-devel; docker run -i --name="$BUILD_TAG-plonesaas" -e GIT_NAME="$GIT_NAME" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plonesaas-devel /debug.sh coverage''' + sh '''mkdir -p xunit-reports; docker cp $BUILD_TAG-plonesaas:/plone/instance/parts/xmltestreport/testreports/. xunit-reports/''' + stash name: "xunit-reports", includes: "xunit-reports/*.xml" + sh '''docker cp $BUILD_TAG-plonesaas:/plone/instance/src/$GIT_NAME/coverage.xml coverage.xml''' + stash name: "coverage.xml", includes: "coverage.xml" + } finally { + sh '''docker rm -v $BUILD_TAG-plonesaas''' + } + junit 'xunit-reports/*.xml' + } } - } - + }, ) } } @@ -157,7 +167,7 @@ pipeline { def nodeJS = tool 'NodeJS11'; withSonarQubeEnv('Sonarqube') { sh '''sed -i "s|/plone/instance/src/$GIT_NAME|$(pwd)|g" coverage.xml''' - sh "export PATH=$PATH:${scannerHome}/bin:${nodeJS}/bin; sonar-scanner -Dsonar.python.xunit.skipDetails=true -Dsonar.python.xunit.reportPath=xunit-reports/*.xml -Dsonar.python.coverage.reportPath=coverage.xml -Dsonar.sources=. -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER" + sh "export PATH=$PATH:${scannerHome}/bin:${nodeJS}/bin; sonar-scanner -Dsonar.python.xunit.skipDetails=true -Dsonar.python.xunit.reportPath=xunit-reports/*.xml -Dsonar.python.coverage.reportPaths=coverage.xml -Dsonar.sources=./sparql-client -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER" 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''' } } diff --git a/docs/HISTORY.txt b/docs/HISTORY.txt index 9523f26..e38725d 100644 --- a/docs/HISTORY.txt +++ b/docs/HISTORY.txt @@ -1,6 +1,13 @@ Changelog ========= +3.9-dev0 - (unreleased) +--------------------------- +* fix import error on older python versions + [valipod refs #140578] +* Bug fix: replace encodestring by encodebytes for py3.9 compatibility + [valipod refs #140578] + 3.8 - (2020-06-17) --------------------------- * Bug fix: fixed Python3 query execution diff --git a/sparql.py b/sparql.py index 1ec2807..5fa63cb 100755 --- a/sparql.py +++ b/sparql.py @@ -47,7 +47,10 @@ Otherwise, the query is read from standard input. """ -from base64 import encodestring +try: + from base64 import encodestring +except ImportError: + from base64 import encodebytes as encodestring from six.moves import input, map from six.moves.urllib.parse import urlencode from xml.dom import pulldom @@ -502,7 +505,7 @@ def _build_request(self, query): separator = '&' else: separator = '?' - uri = self.endpoint.strip() + separator + query + uri = self.endpoint.strip() + str(separator) + str(query) return ev_request.Request(uri) else: # uri = self.endpoint.strip().encode('ASCII') diff --git a/version.txt b/version.txt index cc1923a..e5db3c6 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -3.8 +3.9-dev0