-
Notifications
You must be signed in to change notification settings - Fork 29
Makefile migration: make test
#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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,12 @@ | ||
| GO := go | ||
|
|
||
| # Try to get the dev version using changie, otherwise fall back | ||
| FALLBACK_DEV_VERSION := 3.0.0-dev.0 | ||
| DEV_VERSION := $(shell if command -v changie > /dev/null; then changie next patch -p dev.0; else echo "$(FALLBACK_DEV_VERSION)"; fi) | ||
| SDK_VERSION := $(shell cd pulumi-language-dotnet && sed -n 's/^.*github\.com\/pulumi\/pulumi\/sdk\/v3 v//p' go.mod) | ||
|
|
||
| GO_TEST_FILTER_FLAG := $(if $(TEST_FILTER),-run $(TEST_FILTER)) | ||
| DOTNET_TEST_FILTER_FLAG := $(if $(TEST_FILTER),--filter $(TEST_FILTER)) | ||
|
|
||
| .PHONY: install | ||
| install: | ||
| cd pulumi-language-dotnet && ${GO} install \ | ||
|
|
@@ -96,8 +98,26 @@ lint_integration_tests: format_integration_tests_check | |
| lint_integration_tests_fix: format_integration_tests | ||
| cd integration_tests && golangci-lint run $(GOLANGCI_LINT_ARGS) --fix --config ../.golangci.yml --timeout 5m --path-prefix integration_tests | ||
|
|
||
| test_integration:: build | ||
| cd integration_tests && gotestsum -- --parallel 1 --timeout 60m ./... | ||
| .PHONY: test | ||
| test: test_conformance test_integration test_sdk | ||
|
|
||
| .PHONY: test_conformance | ||
| test_conformance: build clean | ||
| cd pulumi-language-dotnet && gotestsum -- $(GO_TEST_FILTER_FLAG) --timeout 60m ./... | ||
i-am-tom marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| .PHONY: test_integration | ||
| test_integration: build clean | ||
| cd integration_tests && gotestsum -- $(GO_TEST_FILTER_FLAG) --parallel 1 --timeout 60m ./... | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think for this and the conformance tests above, we need to set up
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This and the conformance test target are both unchanged from the previous behaviour, I think? Or is this a TODO for a future PR?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's equally broken before as it is now. So if you want just a bug for bug translation, I guess this works.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm on ops this week, so I'm happy to fix this in a follow-up |
||
|
|
||
| .PHONY: test_sdk | ||
| test_sdk: build clean | ||
| cd sdk && dotnet restore --no-cache | ||
| cd sdk/Pulumi.Tests && dotnet test --configuration Release $(DOTNET_TEST_FILTER_FLAG) | ||
|
|
||
| .PHONY: test_coverage | ||
| test_coverage: test_sdk_coverage | ||
|
|
||
| test_conformance:: build | ||
| cd pulumi-language-dotnet && gotestsum -- --timeout 60m ./... | ||
| .PHONY: test_sdk_coverage | ||
| test_sdk_coverage: clean | ||
| cd sdk && dotnet restore --no-cache | ||
| cd sdk/Pulumi.Tests && dotnet test --configuration Release $(DOTNET_TEST_FILTER_FLAG) -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura -p:CoverletOutput=../../coverage/coverage.pulumi.xml | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this depend on the
cleantarget? We shouldn't need a clean build for this. Also I think that means it runscleanbefore it runs the tests with I think would be wrong.I see that the F# makefile does that in some cases, but I think it shouldn't be necessary, and ideally we make things better here, so we don't need to whole
clean->restoredance.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a Chesterton's fence - like I said in the
format/lintPR, I think the best approach is to migrate F# to Make as directly as possible, and then worry about this in a follow-upThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I guess
cleanonly cleans the SDK bits, which is confusing, but ok. At least we're not cleaning everything we just build here I guess. It's still weird that we clean this. Personally I'd prefer to make things better while we are here, since later cleanups are often forgotten, but I guess it is what we were running before.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed that cleanups get forgotten, but also I'm very keen to keep the scope of these changes very strict as there are plenty of other "quick fixes" I'd love to be adding as I go - I've no doubt this will get revisited when I get back to my CI endeavours, but it seemed like the problem with my original approach in
pulumi/pulumiwas trying to do too many things at once, so I'm still inclined to say this is out of scope for this PR