Skip to content

Conversation

pydctw
Copy link
Contributor

@pydctw pydctw commented Dec 14, 2021

What type of PR is this?
/kind cleanup

What this PR does / why we need it:
Previously, the tests in template_test.go were structured in a way that we couldn't run/debug an individual test case.
This PR refactors the tests to enable an individual run and also improve the test output. It will make debugging easier when tests fail.

BEFORE

=== RUN   Test_RenderCloudformation
--- PASS: Test_RenderCloudformation (0.07s)

AFTER

=== RUN   Test_RenderCloudformation
=== RUN   Test_RenderCloudformation/default
=== RUN   Test_RenderCloudformation/with_ssm_secret_backend
=== RUN   Test_RenderCloudformation/with_all_secret_backends
=== RUN   Test_RenderCloudformation/customsuffix
=== RUN   Test_RenderCloudformation/with_bootstrap_user
=== RUN   Test_RenderCloudformation/with_custom_bootstrap_user
=== RUN   Test_RenderCloudformation/with_different_instance_profiles
=== RUN   Test_RenderCloudformation/with_eks_default_roles
=== RUN   Test_RenderCloudformation/with_eks_kms_prefix
=== RUN   Test_RenderCloudformation/with_extra_statements
=== RUN   Test_RenderCloudformation/with_eks_disable
=== RUN   Test_RenderCloudformation/with_eks_console
--- PASS: Test_RenderCloudformation (0.07s)
    --- PASS: Test_RenderCloudformation/default (0.01s)
    --- PASS: Test_RenderCloudformation/with_ssm_secret_backend (0.01s)
    --- PASS: Test_RenderCloudformation/with_all_secret_backends (0.01s)
    --- PASS: Test_RenderCloudformation/customsuffix (0.01s)
    --- PASS: Test_RenderCloudformation/with_bootstrap_user (0.00s)
    --- PASS: Test_RenderCloudformation/with_custom_bootstrap_user (0.01s)
    --- PASS: Test_RenderCloudformation/with_different_instance_profiles (0.01s)
    --- PASS: Test_RenderCloudformation/with_eks_default_roles (0.01s)
    --- PASS: Test_RenderCloudformation/with_eks_kms_prefix (0.01s)
    --- PASS: Test_RenderCloudformation/with_extra_statements (0.01s)
    --- PASS: Test_RenderCloudformation/with_eks_disable (0.00s)
    --- PASS: Test_RenderCloudformation/with_eks_console (0.01s)
PASS

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:
Continue refactoring and improving code base as I encounter items.

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 14, 2021
@k8s-ci-robot
Copy link
Contributor

@pydctw: This issue is currently awaiting triage.

If CAPA/CAPI contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 14, 2021
@pydctw
Copy link
Contributor Author

pydctw commented Dec 14, 2021

Verified test outputs from the pipeline runs

@Ankitasw
Copy link
Member

@pydctw I think your IDE will allow to run individual tests.

@sedefsavas
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 14, 2021
@sedefsavas sedefsavas added this to the v1.3.0 milestone Dec 14, 2021
@sedefsavas sedefsavas added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Dec 14, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sedefsavas

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 14, 2021
@sedefsavas sedefsavas added needs-priority approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/backlog Higher priority than priority/awaiting-more-evidence. needs-priority labels Dec 14, 2021
@k8s-ci-robot k8s-ci-robot merged commit 2156938 into kubernetes-sigs:main Dec 14, 2021
@k8s-ci-robot k8s-ci-robot modified the milestones: v1.3.0, v1.x Dec 14, 2021
@pydctw pydctw deleted the refactor-template-tests branch January 28, 2022 21:24
richardchen-db pushed a commit to databricks/cluster-api-provider-aws-1 that referenced this pull request Jan 14, 2023
…-tests

Refactor template_test.go to enable an individual run for each test case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants