summaryrefslogtreecommitdiff
path: root/qa/gdk/launch
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 13:49:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 13:49:51 +0000
commit71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch)
tree6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /qa/gdk/launch
parenta7253423e3403b8c08f8a161e5937e1488f5f407 (diff)
downloadgitlab-ce-71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e.tar.gz
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'qa/gdk/launch')
-rwxr-xr-xqa/gdk/launch40
1 files changed, 40 insertions, 0 deletions
diff --git a/qa/gdk/launch b/qa/gdk/launch
new file mode 100755
index 00000000000..4b1fc6ae191
--- /dev/null
+++ b/qa/gdk/launch
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+COMMIT_REF=${1:-$CI_COMMIT_REF_SLUG}
+RSPEC_ARGS=$2
+
+if [ -z "${COMMIT_REF}" ]; then
+ echo "Please provide a commit ref with the code to be tested as the first argument"
+ exit 1
+fi
+
+# Set the GitLab license mode to "test" so that GitLab uses the appropriate encryption key
+export GITLAB_LICENSE_MODE="test"
+
+# Create the temporary directory that screenshots are saved to
+sudo install -m 777 -d /home/gdk/gdk/gitlab/qa/tmp
+
+# Update GDK
+(cd .. ; gdk update ; cat gdk.yml)
+
+# Reset, fetch, and checkout the GitLab repository with the code from the ref to be tested
+git reset --hard
+git fetch origin $COMMIT_REF
+git checkout $COMMIT_REF
+
+# Install the required gems
+bundle install --jobs=$(nproc) --retry=3 --quiet
+
+# Run the database migrations
+bundle exec rake db:migrate
+
+# Restart GDK to be sure any changes are accounted for in running services, start any stopped services, and wait until the GDK is reachable
+(cd .. ; gdk restart ; ./support/test_url http://gdk.test:3000)
+
+# Install the required gems in the QA directory
+cd qa
+bundle install --jobs=$(nproc) --retry=3 --quiet
+
+# Run the tests
+bundle exec rake "knapsack:download[test]"
+bundle exec bin/qa Test::Instance::All http://gdk.test:3000 -- $RSPEC_ARGS || true