diff --git a/Makefile.core.mk b/Makefile.core.mk index 46d463760b..9eea15fd5b 100644 --- a/Makefile.core.mk +++ b/Makefile.core.mk @@ -162,6 +162,9 @@ endif include tests/tests.mk +test_status: + @scripts/test_status.sh + # make lint-yaml seems to fail with pipefail, so remove now. #SHELL = /bin/bash diff --git a/scripts/test_status.sh b/scripts/test_status.sh new file mode 100755 index 0000000000..233898235d --- /dev/null +++ b/scripts/test_status.sh @@ -0,0 +1,75 @@ +#!/bin/bash + +# Copyright Istio Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +echo "Istio Documents Summary: \ + $(find content/en/docs -name '*.md' -exec grep --quiet '^test: yes$' {} \; -print | wc -l) (tested) \ + $(find content/en/docs -name '*.md' -exec grep --quiet '^test: no$' {} \; -print | wc -l) (untested) \ + $(find content/en/docs -name '*.md' -exec grep --quiet '^test: n/a$' {} \; -print | wc -l) (n/a) \ + $(find content/en/docs -name '*.md' -print | wc -l) (total)" + +echo "" +echo "Tasks Docs" +echo "==========" + +echo "Summary: \ + $(find content/en/docs/tasks -name '*.md' -exec grep --quiet '^test: yes$' {} \; -print | wc -l) (tested) \ + $(find content/en/docs/tasks -name '*.md' -exec grep --quiet '^test: no$' {} \; -print | wc -l) (untested) \ + $(find content/en/docs/tasks -name '*.md' -exec grep --quiet '^test: n/a$' {} \; -print | wc -l) (n/a)" + +echo "" +echo "Untested:" +find content/en/docs/tasks -name '*.md' -exec grep --quiet '^test: no$' {} \; -print + +echo "" +echo "Examples Docs" +echo "=============" + +echo "Summary: \ + $(find content/en/docs/examples -name '*.md' -exec grep --quiet '^test: yes$' {} \; -print | wc -l) (tested) \ + $(find content/en/docs/examples -name '*.md' -exec grep --quiet '^test: no$' {} \; -print | wc -l) (untested) \ + $(find content/en/docs/examples -name '*.md' -exec grep --quiet '^test: n/a$' {} \; -print | wc -l) (n/a)" + +echo "" +echo "Untested:" +find content/en/docs/examples -name '*.md' -exec grep --quiet '^test: no$' {} \; -print + +echo "" +echo "Setup Docs" +echo "==========" + +echo "Summary: \ + $(find content/en/docs/setup -name '*.md' -exec grep --quiet '^test: yes$' {} \; -print | wc -l) (tested) \ + $(find content/en/docs/setup -name '*.md' -exec grep --quiet '^test: no$' {} \; -print | wc -l) (untested) \ + $(find content/en/docs/setup -name '*.md' -exec grep --quiet '^test: n/a$' {} \; -print | wc -l) (n/a)" + +echo "" +echo "Untested:" +find content/en/docs/setup -name '*.md' -exec grep --quiet '^test: no$' {} \; -print + +echo "" +echo "Operations Docs" +echo "===============" + +echo "Summary: \ + $(find content/en/docs/ops -name '*.md' -exec grep --quiet '^test: yes$' {} \; -print | wc -l) (tested) \ + $(find content/en/docs/ops -name '*.md' -exec grep --quiet '^test: no$' {} \; -print | wc -l) (untested) \ + $(find content/en/docs/ops -name '*.md' -exec grep --quiet '^test: n/a$' {} \; -print | wc -l) (n/a)" + +echo "" +echo "Untested:" +find content/en/docs/ops -name '*.md' -exec grep --quiet '^test: no$' {} \; -print diff --git a/tests/README.md b/tests/README.md index 02e8f8d93e..7fff8e136b 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,7 +1,7 @@ # Testing istio.io Content This folder contains tests for the content on [istio.io](http://istio.io). -More specifically, these tests confirm that the example and task documents, which contain +More specifically, these tests confirm that the example, task, and other documents, which contain instructions in the form of bash commands and expected output, are working as documented. Generated bash scripts, containing the set of commands and expected output for corresponding @@ -11,6 +11,13 @@ This means that we extract and test the exact same commands that are published i These tests use the framework defined in the `istioio` package, which is a thin wrapper around the [Istio test framework](https://github.com/istio/istio/wiki/Istio-Test-Framework). +Run the following command to see the current test coverage, including the list of documents +that are in need of a test: + +```sh +make test_status +``` + ## Test Authoring Overview To write an `istio.io` test, follow these steps: