Welcome to mirror list, hosted at ThFree Co, Russian Federation.

launch « gdk « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 249484b417ca0072139ff8ec51c3c8e8987ead65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash

COMMIT_REF=${1:-$CI_COMMIT_SHA}
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 bin/qa Test::Instance::All http://gdk.test:3000 -- $RSPEC_ARGS