Skip to content
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

Send tests results to Sheet #6873

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 20 additions & 0 deletions .ibm/pipelines/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,23 @@ skip() {
echo " - $change not in $SKIP_IF_ONLY"
return 0
}

save_results() {
(
cd .ibm/tools/tests-results
echo -n $RESULTS_SERVICE_ACCOUNT > sa.json
JUNIT="$1"
LOGFILE="$2"
NAME="$3"
JOB="$4"
BASE_URL="https://s3.${IBM_REGION}.cloud-object-storage.appdomain.cloud/${IBM_BUCKET}"

GOOGLE_APPLICATION_CREDENTIALS=$PWD/sa.json go run main.go \
--sheetId "${RESULTS_SHEET_ID}" \
--junit "${JUNIT}" \
--pr "${GIT_PR_NUMBER}" \
--job "${JOB}" \
--test "${NAME}" \
--logfile "${BASE_URL}/${LOGFILE}.txt"
)
}
4 changes: 3 additions & 1 deletion .ibm/pipelines/kubernetes-docs-tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

LOGFILE="pr-${GIT_PR_NUMBER}-kubernetes-docs-tests-${BUILD_NUMBER}"
TEST_NAME="Kubernetes Docs Tests"

source .ibm/pipelines/functions.sh

Expand All @@ -17,6 +18,7 @@ cleanup_namespaces

RESULT=${PIPESTATUS[0]}

save_logs "${LOGFILE}" "Kubernetes Docs Tests" ${RESULT}
save_logs "${LOGFILE}" "${TEST_NAME}" ${RESULT}
save_results "${PWD}/test-doc-automation.xml" "${LOGFILE}" "${TEST_NAME}" "${BUILD_NUMBER}"

exit ${RESULT}
5 changes: 3 additions & 2 deletions .ibm/pipelines/kubernetes-tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

LOGFILE="pr-${GIT_PR_NUMBER}-kubernetes-tests-${BUILD_NUMBER}"
TEST_NAME="Kubernetes Tests"

source .ibm/pipelines/functions.sh

Expand All @@ -22,6 +23,6 @@ export SKIP_USER_LOGIN_TESTS=true

RESULT=${PIPESTATUS[0]}

save_logs "${LOGFILE}" "Kubernetes Tests" ${RESULT}

save_logs "${LOGFILE}" "${TEST_NAME}" ${RESULT}
save_results "${PWD}/test-integration.xml" "${LOGFILE}" "${TEST_NAME}" "${BUILD_NUMBER}"
exit ${RESULT}
4 changes: 3 additions & 1 deletion .ibm/pipelines/nocluster-tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

LOGFILE="pr-${GIT_PR_NUMBER}-nocluster-tests-${BUILD_NUMBER}"
TEST_NAME="NoCluster Tests"

source .ibm/pipelines/functions.sh

Expand All @@ -18,6 +19,7 @@ ibmcloud target -r "${IBM_REGION}"

RESULT=${PIPESTATUS[0]}

save_logs "${LOGFILE}" "NoCluster Tests" ${RESULT}
save_logs "${LOGFILE}" "${TEST_NAME}" ${RESULT}
save_results "${PWD}/test-integration-nc.xml" "${LOGFILE}" "${TEST_NAME}" "${BUILD_NUMBER}"

exit ${RESULT}
5 changes: 4 additions & 1 deletion .ibm/pipelines/openshift-tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

LOGFILE="pr-${GIT_PR_NUMBER}-openshift-tests-${BUILD_NUMBER}"
TEST_NAME="OpenShift Tests"

source .ibm/pipelines/functions.sh

Expand All @@ -24,6 +25,8 @@ cleanup_namespaces

RESULT=${PIPESTATUS[0]}

save_logs "${LOGFILE}" "OpenShift Tests" ${RESULT}
save_logs "${LOGFILE}" "${TEST_NAME}" ${RESULT}
save_results "${PWD}/test-integration.xml" "${LOGFILE}" "${TEST_NAME}" "${BUILD_NUMBER}"
save_results "${PWD}/test-e2e.xml" "${LOGFILE}" "${TEST_NAME}" "${BUILD_NUMBER}"

exit ${RESULT}
4 changes: 3 additions & 1 deletion .ibm/pipelines/openshift-unauth-tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

LOGFILE="pr-${GIT_PR_NUMBER}-openshift-unauth-tests-${BUILD_NUMBER}"
TEST_NAME="OpenShift Unauthenticated Tests"

source .ibm/pipelines/functions.sh

Expand All @@ -18,6 +19,7 @@ ibmcloud oc cluster config -c "${CLUSTER_ID}"

RESULT=${PIPESTATUS[0]}

save_logs "${LOGFILE}" "OpenShift Unauthenticated Tests" ${RESULT}
save_logs "${LOGFILE}" "${TEST_NAME}" ${RESULT}
save_results "${PWD}/test-integration-unauth.xml" "${LOGFILE}" "${TEST_NAME}" "${BUILD_NUMBER}"

exit ${RESULT}
14 changes: 11 additions & 3 deletions .ibm/pipelines/windows-test-script.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,19 @@ function Run-Test {
make install
Shout "Running test"
make test-integration-no-cluster | tee -a C:\Users\Administrator.ANSIBLE-TEST-VS\AppData\Local\Temp\$LOGFILE
Check-ExitCode $LASTEXITCODE
$EXITCODE=$LASTEXITCODE
Copy-Item test-integration-nc.xml -Destination C:/Users/Administrator.ANSIBLE-TEST-VS/AppData/Local/Temp
Check-ExitCode $EXITCODE

make test-integration-cluster | tee -a C:\Users\Administrator.ANSIBLE-TEST-VS\AppData\Local\Temp\$LOGFILE
Check-ExitCode $LASTEXITCODE
$EXITCODE=$LASTEXITCODE
Copy-Item test-integration.xml -Destination C:/Users/Administrator.ANSIBLE-TEST-VS/AppData/Local/Temp
Check-ExitCode $EXITCODE

make test-e2e | tee -a C:\Users\Administrator.ANSIBLE-TEST-VS\AppData\Local\Temp\$LOGFILE
Check-ExitCode $LASTEXITCODE
$EXITCODE=$LASTEXITCODE
Copy-Item test-e2e.xml -Destination C:/Users/Administrator.ANSIBLE-TEST-VS/AppData/Local/Temp
Check-ExitCode $EXITCODE

Pop-Location
Shout "Test Finished"
Expand Down
14 changes: 11 additions & 3 deletions .ibm/pipelines/windows-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
# using the IBM DevOps Services.
#

set -x

source .ibm/pipelines/functions.sh

skip_if_only

LOGFILE="pr-${GIT_PR_NUMBER}-windows-tests-${BUILD_NUMBER}"
TEST_NAME="Windows Tests (OCP)"

export REPO=${REPO:-"https://github.com/redhat-developer/odo"}
#copy test script inside /tmp/
sshpass -p $WINDOWS_PASSWORD scp -o StrictHostKeyChecking=no ./.ibm/pipelines/windows-test-script.ps1 Administrator@$WINDOWS_IP:/tmp/windows-test-script.ps1
Expand All @@ -25,7 +25,15 @@ echo "RESULT: $RESULT"
# save log
ibmcloud login --apikey "${API_KEY}" -r "${IBM_REGION}"
sshpass -p $WINDOWS_PASSWORD scp -o StrictHostKeyChecking=no Administrator@$WINDOWS_IP:~/AppData/Local/Temp/${LOGFILE} /tmp/${LOGFILE}
save_logs "${LOGFILE}" "Windows Tests (OCP)" $RESULT
save_logs "${LOGFILE}" "${TEST_NAME}" $RESULT

# save results
sshpass -p $WINDOWS_PASSWORD scp -o StrictHostKeyChecking=no Administrator@$WINDOWS_IP:~/AppData/Local/Temp/test-integration-nc.xml /tmp/
sshpass -p $WINDOWS_PASSWORD scp -o StrictHostKeyChecking=no Administrator@$WINDOWS_IP:~/AppData/Local/Temp/test-integration.xml /tmp/
sshpass -p $WINDOWS_PASSWORD scp -o StrictHostKeyChecking=no Administrator@$WINDOWS_IP:~/AppData/Local/Temp/test-e2e.xml /tmp/
save_results "/tmp/test-integration-nc.xml" "${LOGFILE}" "${TEST_NAME}" "${BUILD_NUMBER}"
save_results "/tmp/test-integration.xml" "${LOGFILE}" "${TEST_NAME}" "${BUILD_NUMBER}"
save_results "/tmp/test-e2e.xml" "${LOGFILE}" "${TEST_NAME}" "${BUILD_NUMBER}"

# cleanup
sshpass -p $WINDOWS_PASSWORD ssh Administrator@$WINDOWS_IP -o StrictHostKeyChecking=no rm -rf /tmp/windows-test-script.ps1
Expand Down
29 changes: 29 additions & 0 deletions .ibm/tools/tests-results/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module github.com/redhat-developer/odo/junit-collector

go 1.19

require (
github.com/joshdk/go-junit v1.0.0
golang.org/x/oauth2 v0.8.0
google.golang.org/api v0.125.0
)

require (
cloud.google.com/go/compute v1.19.3 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.10.0 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/grpc v1.55.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
)
Loading