Remove e2e test of obsolete API
What does this MR do and why?
Removes obsolete code suggestions e2e tests. There's only one production API endpoint for CS. Tests of any internal endpoints should be handled at a lower level.
See gitlab-org/modelops/applied-ml/code-suggestions/ai-assist#253 (closed)
Test result
Here's the result when I ran the test from my machine against gitlab.com (with logging output removed):
❯ CI_PROJECT_NAME='production' \
GITLAB_USERNAME='gitlab-qa' \
GITLAB_QA_ACCESS_TOKEN='<from 1Password>' \
GITLAB_QA_USER_AGENT='<from 1Password>' \
bundle exec bin/qa Test::Instance::All https://gitlab.com -- qa/specs/features/ee/api/14_model_ops/code_suggestions_spec.rb
ModelOps
Code Suggestions
on the GitLab API with PAT auth
returns a suggestion
Top 1 slowest examples (1.29 seconds, 99.4% of total time):
ModelOps Code Suggestions on the GitLab API with PAT auth returns a suggestion
1.29 seconds ./qa/specs/features/ee/api/14_model_ops/code_suggestions_spec.rb:50
Finished in 1.29 seconds (files took 3.77 seconds to load)
1 example, 0 failures
How to set up and validate locally
You can run the test against gitlab.com using the gitlab-qa
user as the test does, or by using your own user. If you use gitlab-qa
you can skip below to running the test, otherwise:
To enable Code Suggestions for your user on gitlab.com:
- Enable the
code_suggestions_completion_api
feature flag
/chatops run feature set --user=<your username> code_suggestions_completion_api true
- Enable the Code Suggestions user preference (this might not be necessary for those of us who are members of
gitlab-org
) See https://docs.gitlab.com/ee/user/project/repository/code_suggestions.html#enable-code-suggestions-for-an-individual-user
To run the tests, from the qa
directory:
export GITLAB_USERNAME=gitlab-qa # or your own username if you have Code Suggestions enabled in your preferences and via the feature flag
export GITLAB_QA_ACCESS_TOKEN=<from 1Password> # or your own access token
export GITLAB_QA_USER_AGENT='<from 1Password>'
export CI_PROJECT_NAME='production' # Needed because the test has `only: :pipeline ['canary production']`
bundle install
bundle exec bin/qa Test::Instance::All https://gitlab.com qa/specs/features/ee/api/14_model_ops/code_suggestions_spec.rb
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.