Skip to content

Add unit tests for executeApplyStage, executePlanStage, and executeRo… - #7109

Open
vishnukothakapu wants to merge 2 commits into
pipe-cd:masterfrom
vishnukothakapu:add-terraform-stage-tests
Open

Add unit tests for executeApplyStage, executePlanStage, and executeRo…#7109
vishnukothakapu wants to merge 2 commits into
pipe-cd:masterfrom
vishnukothakapu:add-terraform-stage-tests

Conversation

@vishnukothakapu

Copy link
Copy Markdown

What this PR does: Adds unit tests for three stage-execution functions in the pipedv1 Terraform plugin: executeApplyStage, executePlanStage, and executeRollbackStage. It also removes the // TODO: add test comments from their respective source files.

The new test suites cover the most common pre-execution failure scenarios (such as an unavailable StageLogPersister across all stages, and an empty CommitHash during the first deployment rollback).

Why we need it: These functions are core to the Terraform plugin's deployment lifecycle but were entirely untested. Adding tests here improves confidence in the pipedv1 plugin architecture, resolves long-standing TODOs, and aligns with the project's existing testing patterns seen in plugin_test.go.

Which issue(s) this PR fixes: Fixes #7108

Does this PR introduce a user-facing change?:

  • How are users affected by this change: No, this is an internal test addition only.
  • Is this breaking change: No
  • How to migrate (if breaking change): N/A

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

👋 Hi @vishnukothakapu, welcome to PipeCD and thanks for opening your first pull request!

We’re really happy to have you here

Before your PR gets merged, please check a few important things below.


Helpful resources


DCO Sign-off

All commits must include a Signed-off-by line to comply with the Developer Certificate of Origin (DCO).

In case you forget to sign-off your commit(s), follow these steps:

For the last commit:

git commit --amend --signoff
git push --force-with-lease

For multiple commits:

git rebase --signoff origin/master
git push --force-with-lease

Run checks locally

Before pushing updates, please run:

make check

This runs the same checks as CI and helps catch issues early.


💬 Need help?

If anything is unclear, feel free to ask in this PR or join us on the CNCF Slack in the #pipecd channel.
You can get your Slack invite from: https://communityinviter.com/apps/cloud-native/cncf

Thanks for contributing to PipeCD! ❤️

@vishnukothakapu
vishnukothakapu force-pushed the add-terraform-stage-tests branch 3 times, most recently from 81c598e to c009364 Compare August 3, 2026 08:05
…llbackStage

Signed-off-by: Vishnu Kothakapu <vishnukothakapu27@gmail.com>
Signed-off-by: Vishnu Kothakapu <vishnukothakapu27@gmail.com>
@vishnukothakapu
vishnukothakapu force-pushed the add-terraform-stage-tests branch from c009364 to 37b17be Compare August 3, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pipedv1][terraform] Add unit tests for executeApplyStage, executePlanStage, and executeRollbackStage

1 participant