summaryrefslogtreecommitdiff
path: root/scripts/glfm
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-20 11:10:13 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-20 11:10:13 +0000
commit0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch)
tree7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /scripts/glfm
parent72123183a20411a36d607d70b12d57c484394c8e (diff)
downloadgitlab-ce-0ea3fcec397b69815975647f5e2aa5fe944a8486.tar.gz
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'scripts/glfm')
-rwxr-xr-xscripts/glfm/run-snapshot-tests.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/scripts/glfm/run-snapshot-tests.sh b/scripts/glfm/run-snapshot-tests.sh
new file mode 100755
index 00000000000..70fdae60edc
--- /dev/null
+++ b/scripts/glfm/run-snapshot-tests.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+# shellcheck disable=SC2059
+
+set -o errexit # AKA -e - exit immediately on errors (http://mywiki.wooledge.org/BashFAQ/105)
+
+# https://stackoverflow.com/a/28938235
+BCyan='\033[1;36m' # Bold Cyan
+BRed='\033[1;31m' # Bold Red
+BGreen='\033[1;32m' # Bold Green
+BBlue='\033[1;34m' # Bold Blue
+Color_Off='\033[0m' # Text Reset
+
+function onexit_err() {
+ local exit_status=${1:-$?}
+ printf "\n❌❌❌ ${BRed}GLFM snapshot tests failed!${Color_Off} ❌❌❌\n"
+ exit "${exit_status}"
+}
+trap onexit_err ERR
+set -o errexit
+
+printf "${BCyan}"
+printf "\nStarting GLFM snapshot example tests. See https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#run-snapshot-testssh-script for more details.\n\n"
+printf "Set 'FOCUSED_MARKDOWN_EXAMPLES=example_name_1[,...]' for focused examples, with example name(s) from https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#glfm_specificationexample_snapshotsexamples_indexyml.\n"
+printf "${Color_Off}"
+
+# This section can be uncommented as soon as this is merged: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/89953
+#printf "\n${BBlue}Running frontend 'yarn jest spec/frontend/content_editor/markdown_snapshot_spec.js'...${Color_Off}\n\n"
+#yarn jest spec/frontend/content_editor/markdown_snapshot_spec.js
+#printf "\n${BBlue}'yarn jest spec/frontend/content_editor/markdown_snapshot_spec.js' passed!${Color_Off}\n\n"
+
+printf "\n${BBlue}Running backend 'bundle exec rspec spec/requests/api/markdown_snapshot_spec.rb'...${Color_Off}\n\n"
+bundle exec rspec spec/requests/api/markdown_snapshot_spec.rb
+printf "\n${BBlue}'bundle exec rspec spec/requests/api/markdown_snapshot_spec.rb' passed!${Color_Off}\n\n"
+
+printf "\n✅✅✅ ${BGreen}All GLFM snapshot example tests passed successfully!${Color_Off} ✅✅✅\n"