test(duo ask): integration test for duo ask
Description
With the GA of glab duo ask --git
, this adds an integration test for the feature. The test asks a simple git question and expects a particular git command in response.
Some pipeline changes were needed to accomodate this. We now need a token with api
scope and the token also needs a duo pro seat.
The CI variable GITLAB_TOKEN_TEST
token has been updated to use a test user with a duo seat and to have the api
scope. (1Password updated also)
Currently the integration tests fail if run from a fork when the token is not set, now they will be skipped. However, the integration tests will still run when a project member creates a pipeline or when the merge train runs. They will also still be run if a GITLAB_TOKEN_TEST
and GITLAB_TEST_HOST
is set in the project. Discussions around the pipeline changes are in the below thread !1587 (comment 1996152099)
Related Issues
Resolves #7520 (closed)
How has this been tested?
Test is passing in this pipeline here: https://gitlab.com/gitlab-org/cli/-/jobs/7393149660#L88
To test the CI changes, see: !1587 (comment 2002585158)
I created an MR from a fork from a non-member and observed that the integration tests did not run as expected. I then ran a pipeline as a project member and the integration tests did run.
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms) -
Test gap