Skip to content

E2E: Add spec for Login with GitLab as OIDC idP and consumer

Description of the test

Adds an e2e test that creates an OIDC Application and uses it to login to GitLab. This is also a corrective action related to FCL-8664

Related issue: gitlab-org/quality/testcases#3984 (closed) FCL issue: &10270 (closed)

Note: gitlab-qa!1154 (merged) must be merged and a new gem version released before this can be merged.

How to set up and validate locally

  1. Make sure your GDK is set to run on a non-localhost address such as gdk.test:3000.
  2. Configure a loopback interface 172.16.123.1
  3. Make sure Docker desktop or Rancher desktop is running.
  4. Add an entry for gitlab-oidc-consumer.bridge pointing to 127.0.0.1 to your /etc/hosts file.
  5. From the qa directory:
bundle install

RELEASE_REGISTRY_URL='registry.gitlab.com' RELEASE_REGISTRY_USERNAME='<your_gitlab_username>' RELEASE_REGISTRY_PASSWORD='<your_gitlab_personal_access_token>' RELEASE='registry.gitlab.com/gitlab-org/build/omnibus-gitlab-mirror/gitlab-ee:1d5a644145dfe901ea7648d825f8f9f3006d0acf' GITLAB_QA_ADMIN_ACCESS_TOKEN="<your_gdk_admin_personal_access_token>" QA_DEBUG=true CHROME_HEADLESS=false bundle exec bin/qa Test::Instance::All http://gdk.test:3000 qa/specs/features/browser_ui/1_manage/login/login_via_oidc_with_gitlab_as_idp_spec.rb

Checklist

  • Confirm the test has a testcase: tag linking to an existing test case in the test case project.
  • Note if the test is intended to run in specific scenarios. If a scenario is new, add a link to the MR that adds the new scenario.
  • Follow the end-to-end tests style guide and best practices.
  • Use the appropriate RSpec metadata tag(s).
  • Most resources will be cleaned up via the general cleanup task. Check that is successful, or ensure resources are cleaned up in the test:
    • New resources have api_get_path and api_delete_path implemented if possible.
    • If any resource cannot be deleted in the general delete task, make sure it is ignored.
    • If any resource cannot be deleted in the general delete task, remove it in the test (e.g., in an after block).
  • Ensure that no transient bugs are hidden accidentally due to the usage of waits and reloads.
  • Verify the tags to ensure it runs on the desired test environments.
  • If this MR has a dependency on another MR, such as a GitLab QA MR, specify the order in which the MRs should be merged.
  • (If applicable) Create a follow-up issue to document the special setup necessary to run the test: ISSUE_LINK
  • If the test requires an admin's personal access token, ensure that the test passes on your local environment with and without the GITLAB_QA_ADMIN_ACCESS_TOKEN provided.
Edited by Sanad Liaquat

Merge request reports