diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-28 12:09:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-28 12:09:34 +0300 |
commit | 9be7fbd46fad857f97ce40709f60718f627aba71 (patch) | |
tree | c7a4665352979baf1cb75117a7e25edc96d147b3 /scripts | |
parent | 4d1d3eb5e7fbd217db8d721beb3a72075e266f3e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/remote_development/run-e2e-tests.sh | 36 | ||||
-rwxr-xr-x | scripts/remote_development/run-smoke-test-suite.sh | 71 |
2 files changed, 107 insertions, 0 deletions
diff --git a/scripts/remote_development/run-e2e-tests.sh b/scripts/remote_development/run-e2e-tests.sh new file mode 100755 index 00000000000..905bef4754d --- /dev/null +++ b/scripts/remote_development/run-e2e-tests.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env zsh + +# frozen_string_literal: true + +# This is a convenience script to run the Remote Development category E2E spec(s) against a local +# GDK environment. It sets default values for the necessary environment variables, but allows +# them to be overridden. +# +# For details on how to run this, see the documentation comments at the top of +# qa/qa/specs/features/ee/browser_ui/3_create/remote_development/create_new_workspace_and_terminate_spec.rb + +DEFAULT_PASSWORD='5iveL!fe' + +export WEBDRIVER_HEADLESS="${WEBDRIVER_HEADLESS:-0}" +export QA_SUPER_SIDEBAR_ENABLED="${QA_SUPER_SIDEBAR_ENABLED:-1}" # This is currently necessary for the test to pass +export GITLAB_USERNAME="${GITLAB_USERNAME:-root}" +export GITLAB_PASSWORD="${GITLAB_PASSWORD:-${DEFAULT_PASSWORD}}" +export DEVFILE_PROJECT="${DEVFILE_PROJECT:-Gitlab Org / Gitlab Shell}" +export AGENT_NAME="${AGENT_NAME:-remotedev}" +export TEST_INSTANCE_URL="${TEST_INSTANCE_URL:-http://gdk.test:3000}" + +echo "WEBDRIVER_HEADLESS: ${WEBDRIVER_HEADLESS}" +echo "QA_SUPER_SIDEBAR_ENABLED: ${QA_SUPER_SIDEBAR_ENABLED}" +echo "GITLAB_USERNAME: ${GITLAB_USERNAME}" +echo "DEVFILE_PROJECT: ${AGENT_NAME}" +echo "AGENT_NAME: ${AGENT_NAME}" +echo "TEST_INSTANCE_URL: ${TEST_INSTANCE_URL}" + +working_directory="$(git rev-parse --show-toplevel)/qa" + +# TODO: https://gitlab.com/gitlab-org/gitlab/-/issues/397005 +# Remove the '--tag quarantine' from below once this test is removed from quarantine +(cd "$working_directory" && \ + bundle && \ + bundle exec bin/qa Test::Instance::All "$TEST_INSTANCE_URL" -- \ + --tag quarantine qa/specs/features/ee/browser_ui/3_create/remote_development) diff --git a/scripts/remote_development/run-smoke-test-suite.sh b/scripts/remote_development/run-smoke-test-suite.sh new file mode 100755 index 00000000000..5c1c5532a05 --- /dev/null +++ b/scripts/remote_development/run-smoke-test-suite.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash + +# This script runs a suite of non-E2E specs related to the Remote Development category, as +# a pre-commit/pre-push "Smoke Test" to catch any broken tests without having to wait +# on CI to catch them. Note that there are some shared/common specs related to +# Remote Development which are not included in this suite. +# https://en.wikipedia.org/wiki/Smoke_testing_(software) + +# 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}Remote Development specs failed!${Color_Off} ❌❌❌\n" + exit "${exit_status}" +} +trap onexit_err ERR +set -o errexit + +printf "${BCyan}" +printf "\nStarting Remote Development specs.\n\n" +printf "${Color_Off}" + +printf "${BBlue}Running Remote Development backend specs${Color_Off}\n\n" + +# NOTE: For some reason this test started causing the following spec file in the list to blow up with +# "Failed to write to log, write log/workhorse-test.log: file already closed". Just removing +# it for now. +# ee/spec/graphql/api/workspace_spec.rb + +bin/spring rspec -r spec_helper \ +ee/spec/features/remote_development/workspaces_spec.rb \ +ee/spec/finders/remote_development/workspaces_finder_spec.rb \ +ee/spec/graphql/types/query_type_spec.rb \ +ee/spec/graphql/types/remote_development/workspace_type_spec.rb \ +ee/spec/graphql/types/subscription_type_spec.rb \ +ee/spec/lib/remote_development/workspaces/create/create_processor_spec.rb \ +ee/spec/lib/remote_development/workspaces/create/devfile_processor_spec.rb \ +ee/spec/lib/remote_development/workspaces/create/devfile_validator_spec.rb \ +ee/spec/lib/remote_development/workspaces/reconcile/actual_state_calculator_spec.rb \ +ee/spec/lib/remote_development/workspaces/reconcile/agent_info_parser_spec.rb \ +ee/spec/lib/remote_development/workspaces/reconcile/agent_info_spec.rb \ +ee/spec/lib/remote_development/workspaces/reconcile/desired_config_generator_spec.rb \ +ee/spec/lib/remote_development/workspaces/reconcile/params_parser_spec.rb \ +ee/spec/lib/remote_development/workspaces/reconcile/reconcile_processor_scenarios_spec.rb \ +ee/spec/lib/remote_development/workspaces/reconcile/reconcile_processor_spec.rb \ +ee/spec/lib/remote_development/workspaces/states_spec.rb \ +ee/spec/lib/remote_development/workspaces/update/update_processor_spec.rb \ +ee/spec/models/remote_development/remote_development_agent_config_spec.rb \ +ee/spec/models/remote_development/workspace_spec.rb \ +ee/spec/requests/api/graphql/mutations/remote_development/workspaces/create_spec.rb \ +ee/spec/requests/api/graphql/mutations/remote_development/workspaces/update_spec.rb \ +ee/spec/requests/api/graphql/remote_development/current_user_workspaces_spec.rb \ +ee/spec/requests/api/graphql/remote_development/workspaces_by_ids_spec.rb \ +ee/spec/requests/api/graphql/remote_development/workspace_by_id_spec.rb \ +ee/spec/requests/api/internal/kubernetes_spec.rb \ +ee/spec/services/remote_development/agent_config/update_service_spec.rb \ +ee/spec/services/remote_development/workspaces/create_service_spec.rb \ +ee/spec/services/remote_development/workspaces/reconcile_service_spec.rb \ +ee/spec/services/remote_development/workspaces/update_service_spec.rb \ +spec/graphql/types/subscription_type_spec.rb \ + +printf "\n✅✅✅ ${BGreen}All Remote Development specs passed successfully!${Color_Off} ✅✅✅\n" |