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

Run Docs tests on CI/CD #6521

Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .ibm/pipelines/kubernetes-docs-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

LOGFILE="pr-${GIT_PR_NUMBER}-kubernetes-docs-tests-${BUILD_NUMBER}"

source .ibm/pipelines/functions.sh

ibmcloud login --apikey "${API_KEY_QE}"
ibmcloud target -r "${IBM_REGION}"
ibmcloud ks cluster config --cluster "${IBM_KUBERNETES_ID}" --admin

cleanup_namespaces
(
set -e
make install
make test-doc-automation
) |& tee "/tmp/${LOGFILE}"

RESULT=${PIPESTATUS[0]}

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

exit ${RESULT}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,4 @@ test-e2e:

.PHONY: test-doc-automation
test-doc-automation:
$(RUN_GINKGO) $(GINKGO_FLAGS) --junit-report="test-doc-automation.xml" tests/documentation/...
$(RUN_GINKGO) $(GINKGO_FLAGS_ONE) --junit-report="test-doc-automation.xml" tests/documentation/...
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo init --devfile nodejs-react --name my-nr-app
__
/ \__ Initializing a new component
\__/ \
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

✓ Downloading devfile "nodejs-react" [3s]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo init --name my-spring-app --devfile java-springboot --devfile-registry Def
__
/ \__ Initializing a new component
\__/ \
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

✓ Downloading devfile "java-springboot" from registry "DefaultDevfileRegistry" [4s]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo init --devfile-path https://registry.devfile.io/devfiles/nodejs-angular --
__
/ \__ Initializing a new component
\__/ \
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

✓ Downloading devfile from "https://registry.devfile.io/devfiles/nodejs-angular" [1s]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo init
__
/ \__ Initializing a new component
\__/ \ Files: Source code detected, a Devfile will be determined based upon source code autodetection
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

Interactive mode enabled, please answer the following questions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo init
__
/ \__ Initializing a new component
\__/ \ Files: No source code detected, a starter project will be created in the current directory
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

Interactive mode enabled, please answer the following questions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo init --devfile go --name my-go-app --devfile-version latest
__
/ \__ Initializing a new component
\__/ \
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

✓ Downloading devfile "go:latest" [4s]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo init --devfile go --name my-go-app --devfile-version 2.0.0
__
/ \__ Initializing a new component
\__/ \
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

✓ Downloading devfile "go:2.0.0" [3s]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo deploy
__
/ \__ Deploying the application using my-dotnet-app Devfile
\__/ \ Namespace: odo-dev
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

↪ Building & Pushing Container: quay.io/MYUSERNAME/dotnet-odo-example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo deploy
__
/ \__ Deploying the application using my-go-app Devfile
\__/ \ Namespace: odo-dev
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

↪ Building & Pushing Container: quay.io/MYUSERNAME/go-odo-example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo deploy
__
/ \__ Deploying the application using my-java-app Devfile
\__/ \ Namespace: odo-dev
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

↪ Building & Pushing Container: quay.io/MYUSERNAME/java-odo-example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo deploy
__
/ \__ Deploying the application using my-nodejs-app Devfile
\__/ \ Namespace: odo-dev
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

↪ Building & Pushing Container: quay.io/MYUSERNAME/nodejs-odo-example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo dev
__
/ \__ Developing using the "my-dotnet-app" Devfile
\__/ \ Namespace: odo-dev
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

↪ Running on the cluster in Dev mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo init
__
/ \__ Initializing a new component
\__/ \ Files: Source code detected, a Devfile will be determined based upon source code autodetection
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

Interactive mode enabled, please answer the following questions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo dev
__
/ \__ Developing using the "my-go-app" Devfile
\__/ \ Namespace: odo-dev
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

↪ Running on the cluster in Dev mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo init
__
/ \__ Initializing a new component
\__/ \ Files: Source code detected, a Devfile will be determined based upon source code autodetection
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

Interactive mode enabled, please answer the following questions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo dev
__
/ \__ Developing using the "my-java-app" Devfile
\__/ \ Namespace: odo-dev
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

↪ Running on the cluster in Dev mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo init
__
/ \__ Initializing a new component
\__/ \ Files: Source code detected, a Devfile will be determined based upon source code autodetection
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

Interactive mode enabled, please answer the following questions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo dev
__
/ \__ Developing using the "my-nodejs-app" Devfile
\__/ \ Namespace: odo-dev
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

↪ Running on the cluster in Dev mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ odo init
__
/ \__ Initializing a new component
\__/ \ Files: Source code detected, a Devfile will be determined based upon source code autodetection
/ \__/ odo version: v3.5.0
/ \__/ odo version: v3.6.0
\__/

Interactive mode enabled, please answer the following questions:
Expand Down
4 changes: 4 additions & 0 deletions tests/helper/helper_documentation.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ func StripSpinner(docString string) (returnString string) {
if (strings.HasPrefix(line, "• Downloading") || strings.HasPrefix(line, "• Syncing") || strings.HasPrefix(line, "• Building")) && strings.HasSuffix(line, "...") {
continue
}
// Remove warnings, execpt "Pod is Pending"
if strings.HasPrefix(line, "⚠") && !strings.Contains(line, "Pod is Pending") {
continue
}

// for some reason, splitting the docString by \n does not split the spinner frames,
// so we perform a side operation to remove the extra spinner frames that are not present in the final output
Expand Down