gitlab_project_access_token: Test bugfix and destroy improvement

Description

Fixes #1002 (closed)

  • Fixed a test bug where a hardcoded expiration date that passed caused failures
  • Improved the destroy function to wait for the token to finish deleting

Note the diff to the resourceGitlabProjectAccessTokenRead looks large, but actually it is a straight move. I moved the list API calls into a resourceGitlabProjectAccessTokenFind function because I had to use it in the destroy logic also.

PR Checklist Acknowledgement

  • I acknowledge that all of the following items are true, where applicable:
    • Resource attributes match 1:1 the names and structure of the API resource in the GitLab API documentation.
    • Examples are updated with:
      • A *.tf file for the resource/s with at least one usage example
      • A *.sh file for the resource/s with an import example (if applicable)
    • New resources have at minimum a basic test with three steps:
      • Create the resource
      • Update the attributes
      • Import the resource
    • No new //lintignore comments were copied from existing code. (Linter rules are meant to be enforced on new code.)

Merge request reports

Loading