From 15c7053489bb1afa6e013707410f7763c3fced2e Mon Sep 17 00:00:00 2001 From: Jay McCure Date: Thu, 12 Jun 2025 12:39:55 +1000 Subject: [PATCH] Adjust ai-gateway no add on scenario to verify service access token Changelog: changed --- docs/what_tests_can_be_run.md | 23 +++++-------------- .../test/integration/ai_gateway_base.rb | 3 +-- .../test/integration/ai_gateway_no_add_on.rb | 20 ---------------- .../test/omnibus/update_from_previous_ai.rb | 2 +- support/setup/gitlab_duo_setup.rb | 2 -- 5 files changed, 8 insertions(+), 42 deletions(-) delete mode 100644 lib/gitlab/qa/scenario/test/integration/ai_gateway_no_add_on.rb diff --git a/docs/what_tests_can_be_run.md b/docs/what_tests_can_be_run.md index 07ceb0dc..001e11aa 100644 --- a/docs/what_tests_can_be_run.md +++ b/docs/what_tests_can_be_run.md @@ -1239,32 +1239,21 @@ $ gitlab-qa Test::Integration::AiGateway EE #### `Test::Integration::AiGatewayNoSeatAssigned EE|` - Runs tests tagged with `:ai_gateway_no_seat_assigned` -- GitLab instance has a cloud license + Duo Pro or Duo Enterprise add-on, but no seat is assigned to the admin user. - -Example: - -```shell -$ gitlab-qa Test::Integration::AiGatewayNoSeatAssigned EE -``` - ----- - -#### `Test::Integration::AiGatewayNoAddOn EE|` - -- Runs tests tagged with `:ai_gateway_no_add_on` -- GitLab instance has a cloud license without a Duo Pro or Duo Enterprise add-on, and no seat is assigned to the admin user. +- No seat is assigned to the admin user. **Regarding environment variables:** -- `QA_EE_ACTIVATION_CODE` should be set to a Staging-generated Premium or Ultimate cloud license _without_ a Duo Pro or Duo Enterprise add-on. +- The value of `QA_EE_ACTIVATION_CODE` will determine the behavior of AI features when user does not have a seat assigned. + - If set to a Staging-generated Premium or Ultimate cloud license _without_ a Duo Pro or Duo Enterprise add-on, behavior will be Duo Core + - If set to a Staging-generated Premium or Ultimate cloud license _with_ a Duo Pro or Duo Enterprise add-on, behavior will be Duo Pro/Enterprise Example: ```shell -$ gitlab-qa Test::Integration::AiGatewayNoAddOn EE +$ gitlab-qa Test::Integration::AiGatewayNoSeatAssigned EE ``` ---- +---- #### `Test::Integration::AiGatewayNoLicense EE|` diff --git a/lib/gitlab/qa/scenario/test/integration/ai_gateway_base.rb b/lib/gitlab/qa/scenario/test/integration/ai_gateway_base.rb index 3a889a9a..98cfe03d 100644 --- a/lib/gitlab/qa/scenario/test/integration/ai_gateway_base.rb +++ b/lib/gitlab/qa/scenario/test/integration/ai_gateway_base.rb @@ -15,7 +15,6 @@ module Gitlab @ai_gateway_hostname = "#{@ai_gateway_name}.#{@network}" @ai_gateway_port = 5000 @use_cloud_license = true - @has_add_on = true @assign_seats = true end @@ -62,7 +61,7 @@ module Gitlab gitlab.docker.exec( gitlab.name, - "ASSIGN_SEATS=#{@assign_seats} HAS_ADD_ON=#{@has_add_on} gitlab-rails runner #{SETUP_DEST_PATH}/gitlab_duo_setup.rb", + "ASSIGN_SEATS=#{@assign_seats} gitlab-rails runner #{SETUP_DEST_PATH}/gitlab_duo_setup.rb", mask_secrets: gitlab.secrets ) end diff --git a/lib/gitlab/qa/scenario/test/integration/ai_gateway_no_add_on.rb b/lib/gitlab/qa/scenario/test/integration/ai_gateway_no_add_on.rb deleted file mode 100644 index a52e1691..00000000 --- a/lib/gitlab/qa/scenario/test/integration/ai_gateway_no_add_on.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module Gitlab - module QA - module Scenario - module Test - module Integration - class AiGatewayNoAddOn < AiGatewayBase - def initialize - super - @tag = 'ai_gateway_no_add_on' - @has_add_on = false - @assign_seats = false - end - end - end - end - end - end -end diff --git a/lib/gitlab/qa/scenario/test/omnibus/update_from_previous_ai.rb b/lib/gitlab/qa/scenario/test/omnibus/update_from_previous_ai.rb index a2a189d0..4a9b3279 100644 --- a/lib/gitlab/qa/scenario/test/omnibus/update_from_previous_ai.rb +++ b/lib/gitlab/qa/scenario/test/omnibus/update_from_previous_ai.rb @@ -34,7 +34,7 @@ module Gitlab gitlab.docker.exec( gitlab.name, - "ASSIGN_SEATS=true HAS_ADD_ON=true gitlab-rails runner #{setup_dest_path}/gitlab_duo_setup.rb", + "ASSIGN_SEATS=true gitlab-rails runner #{setup_dest_path}/gitlab_duo_setup.rb", mask_secrets: gitlab.secrets ) end diff --git a/support/setup/gitlab_duo_setup.rb b/support/setup/gitlab_duo_setup.rb index 7ddcfa47..44a817d4 100644 --- a/support/setup/gitlab_duo_setup.rb +++ b/support/setup/gitlab_duo_setup.rb @@ -7,8 +7,6 @@ class GitlabDuoSetup def configure! activate_cloud_license - return unless enabled?('HAS_ADD_ON') - # The seat links endpoint in CustomersDot is rate limited and can sometimes # prevent the service access token from being generated during license activation # This generates the token directly, similar to the sync_service_token_worker cron job -- GitLab