Skip to content

test(azure-functions): add unit tests for deployment, livestate, and provider packages - #51

Open
vanshika2720 wants to merge 1 commit into
pipe-cd:mainfrom
vanshika2720:test/azure-functions-coverage
Open

test(azure-functions): add unit tests for deployment, livestate, and provider packages#51
vanshika2720 wants to merge 1 commit into
pipe-cd:mainfrom
vanshika2720:test/azure-functions-coverage

Conversation

@vanshika2720

Copy link
Copy Markdown

What this PR does

Adds unit tests for the Azure Functions plugin covering pipeline stage building, quick-sync stages, plugin dispatch methods, Azure-client-interface-backed livestate logic using a mock AzureClient, and deterministic provider logic such as ARM template parsing and SAS URL validation.

Adds testify as a test dependency, following the existing testing pattern used by the sqldef plugin.

Why we need it / Without this PR, what is the problem?

The Azure Functions plugin previously had no unit test coverage, making it difficult to verify its business logic and detect regressions.

This PR adds coverage for the logic that can be tested without external Azure services. The overall package coverage increases from 0% to approximately 26%, with the livestate package reaching approximately 82% coverage.

Some Azure stage-execution paths remain uncovered because they directly create an Azure client and require external Azure services. Testing those paths fully would require either live credentials/network access or production-code changes, which are outside the scope of this PR.

…provider packages

Covers pure business logic (pipeline stage building, quick-sync stages),
plugin dispatch methods, and Azure-client-interface-backed livestate logic
with a mock AzureClient, plus the deterministic branches of the provider
package (ARM template parsing, SAS URL validation). Adds testify as a test
dependency to match the pattern already used by the sqldef plugin.

Signed-off-by: Vanshika <pahalvanshikaa@gmail.com>
@vanshika2720

Copy link
Copy Markdown
Author

@khanhtc1202 @t-kikuc

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.

1 participant