Skip to content

Makefile migration: make test-sdk #636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,18 @@ lint::
--path-prefix $(pkg)) \
&&) true

# Test the SDK
test-sdk::
@echo "Testing Pulumi SDK"
$(MAKE) clean-sdk
cd sdk && dotnet restore --no-cache
cd sdk/Pulumi.Tests && dotnet test --configuration Release

# Test the SDK with coverage
test-sdk-coverage::
@echo "Testing Pulumi SDK with coverage"
$(MAKE) clean-sdk
cd sdk && dotnet restore --no-cache
cd sdk/Pulumi.Tests && dotnet test --configuration Release -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura -p:CoverletOutput=../../coverage/coverage.pulumi.xml

.PHONY: install build
12 changes: 6 additions & 6 deletions build/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ let testLanguagePlugin() =
then failwith "Testing pulumi-language-dotnet failed"

let testPulumiSdk coverage =
cleanSdk()
restoreSdk()
printfn "Testing Pulumi SDK"
let coverageArgs = if coverage then $" -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura -p:CoverletOutput={coverageDir}/coverage.pulumi.xml" else ""
if Shell.Exec("dotnet", "test --configuration Release" + coverageArgs, pulumiSdkTests) <> 0
then failwith "tests failed"
printfn "Deprecated: calling `make test-sdk%s` instead" (if coverage then "-coverage" else "")
let target = if coverage then "test-sdk-coverage" else "test-sdk"
let cmd = Cli.Wrap("make").WithArguments(target).WithWorkingDirectory(repositoryRoot)
let output = cmd.ExecuteAsync().GetAwaiter().GetResult()
if output.ExitCode <> 0 then
failwith "tests failed"

let testPulumiAutomationSdk coverage =
cleanSdk()
Expand Down
Loading