UNCLASSIFIED - NO CUI

Skip to content

Resolves "Update Scripted Test to Remove Dependency on Cypress Created UI Tests" | SKIP UPDATE

Daniel Pritchett requested to merge djp-clean-tests into main

General MR

Summary

Per #233 (closed),

Previously this package's helm tests for Cypress created objects that became dependencies for this package's bash-based helm tests. This MR fixes that.

  • rewrites ./chart/tests/scripts/test.sh to not depend on objects created by the Cypress tests
    • leverages @jimmy.bourque's newly created devops-tester image to create its own admin token for curl-based testing
      • uses kubectl and jq for that.
      • uses skopeo for container image operations instead of crane because the pipelines team is moving away from crane.
    • test.sh cleans up after itself when complete: deletes new gitlab project and its images, deactivates its newly created temporary root token.
  • Rewrites the Cypress tests to delete the gitlab objects they created, meaning the test.sh tests can't depend on them anymore.
  • Chart preloads a paired gitlab-test-pod-exec Role and RoleBinding to enable the test.sh script to kubectl exec.
    • test.sh removes the gitlab-test-pod-exec Role via kubectl delete at the end of the test. It can't delete both the Role and the RoleBinding because both of them have to exist in order to issue a delete command for either one. I chose to leave the RoleBinding in place and remove the Role.
    • n.b. this currently has to bind to the built-in account system:serviceaccount:gitlab:default, while it should probably be binding to a gluon-specific named ServiceAccount. I've submitted an issue at gluon#40 (closed) to propose that as an option.

Relevant logs/screenshots

Tests passing in CI as desired!

Test log: https://repo1.dso.mil/big-bang/product/packages/gitlab/-/jobs/36286161

image

Linked Issue

Upgrade Notices

N/A

Edited by Daniel Pritchett

Merge request reports

Loading