Skip to content
代码片段 群组 项目
提交 ab4dc9c0 编辑于 作者: Chad Woolley's avatar Chad Woolley 提交者: Paul Slaughter
浏览文件

Add remote dev scripts dir, tweak e2e spec

上级 77303b21
No related branches found
No related tags found
无相关合并请求
......@@ -57,7 +57,8 @@ NOT_AVAILABLE_TEMPLATES = {
default: 'No %{role} available',
product_intelligence: group_not_available_template('#g_analyze_analytics_instrumentation', '@gitlab-org/analytics-section/product-intelligence/engineers'),
import_integrate_be: group_not_available_template('#g_manage_import_and_integrate', '@gitlab-org/manage/import-and-integrate'),
import_integrate_fe: group_not_available_template('#g_manage_import_and_integrate', '@gitlab-org/manage/import-and-integrate')
import_integrate_fe: group_not_available_template('#g_manage_import_and_integrate', '@gitlab-org/manage/import-and-integrate'),
remote_development: group_not_available_template('#f_remote_development', '@gitlab-org/remote-development')
}.freeze
def note_for_spin_role(spin, role, category)
......
......@@ -22,7 +22,6 @@ def select_cluster_agent(agent)
options = agent_selector.all('option')
raise "No agent available" if options.empty?
raise "No matching agent found" if options.none? { |option| option.text == agent }
agent_selector.select agent
end
......
......@@ -8,24 +8,14 @@
#
# How to setup the test
#
# 1. Ensure gitlab is up and running with default KAS / agentk stopped
# 2. Setup agentk for a group and start agentk with the token received.
# (This agent name is passed in variable AGENTK_NAME)
# 3. Add a project under the same group and add a file named .devfile.yaml with below content.
# (This project name is passed in variable DEVFILE_PROJECT)
# devfile_content = <<~YAML
# schemaVersion: 2.2.0
# components:
# - name: tooling-container
# attributes:
# gl/inject-editor: true
# container:
# image: quay.io/mloriedo/universal-developer-image:ubi8-dw-demo
# YAML
# 4. Call the helper scripts at `scripts/remote_development/run_e2e_spec.sh` with DEVFILE_PROJECT and AGENTK_NAME
# For example, to override any variable, the script can be run in the following manner
# DEVFILE_PROJECT="devfile-test-project" AGENTK_NAME="test-agent" GITLAB_PASSWORD=example
# TEST_INSTANCE_URL=https://gdk.test:3000 scripts/remote_development/run-e2e-spec.sh
# 1. Follow this documentation to set up your local GDK environment for creating remote development workspaces:
# https://gitlab.com/gitlab-org/remote-development/gitlab-remote-development-docs/-/blob/main/doc/local-development-environment-setup.md
# 2. Ensure that you can successfully create and terminate workspaces in your local GDK environment.
# 3. Call the helper script at `scripts/remote_development/run-e2e-tests.sh`.
# If you used all the default suggested group/project/agent values in the documentation above, the default values
# should work for you. Otherwise, any variable can be overridden on the command line, for example:
#
# DEVFILE_PROJECT="devfile-test-project" AGENT_NAME="test-agent" scripts/remote_development/run-e2e-tests.sh
module QA
RSpec.describe 'Create',
......@@ -35,10 +25,10 @@ module QA
}, product_group: :ide do
describe 'Remote Development' do
let(:devfile_project_name) { ENV.fetch("DEVFILE_PROJECT", "devfile-project-example") }
let(:agent) { ENV.fetch("AGENTK_NAME", "test-agentk") }
let(:agent) { ENV.fetch("AGENT_NAME", "test-agent") }
before do
Flow::Login.sign_in
Flow::Login.sign_in(skip_page_validation: true)
end
it 'creates a new workspace and then stops and terminates it',
......
#!/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)
#!/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"
......@@ -112,6 +112,7 @@
'scripts/glfm/bar.rb' | [:backend]
'scripts/glfm/bar.js' | [:frontend]
'scripts/remote_development/run-smoke-test-suite.sh' | [:remote_development]
'scripts/lib/glfm/bar.rb' | [:backend]
'scripts/lib/glfm/bar.js' | [:frontend]
'scripts/bar.rb' | [:backend, :tooling]
......
......@@ -115,6 +115,7 @@ module ProjectHelper
%r{\A((ee|jh)/)?scripts/(lib/)?glfm/.*\.rb} => [:backend],
%r{\A((ee|jh)/)?scripts/(lib/)?glfm/.*\.js} => [:frontend],
%r{\A((ee|jh)/)?scripts/remote_development/.*} => [:remote_development],
%r{\A((ee|jh)/)?scripts/.*\.rb} => [:backend, :tooling],
%r{\A((ee|jh)/)?scripts/.*\.js} => [:frontend, :tooling],
%r{\A((ee|jh)/)?scripts/} => :tooling,
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册