Skip to content

Commit 11c9fda

Browse files
Add conformance for projectRoot pcl function
I also added a cache clear before testing to purge any old versions with the same version number if present, as well as some docs describing this issue which cost me an hour. Part of #18565 Blocked by #18595 Changes required to get project root in dotnet and have conformance tests pass.
1 parent 12f56a3 commit 11c9fda

File tree

14 files changed

+526
-66
lines changed

14 files changed

+526
-66
lines changed

CHANGELOG_PENDING.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Add conformance for rootDirectory to the sdk

CONTRIBUTING.md

+23
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,29 @@ $ changie new
1717
✔ GitHub Pull Request … 123
1818
```
1919

20+
## Running conformance tests
21+
22+
When running conformance tests, nuget package caches can sometimes cause updates do the SDK to fail,
23+
in this case you can fix it by deleting the pulumi package from your cache like so:
24+
25+
```shell
26+
rm -rf ~/.nuget/packages/pulumi/
27+
```
28+
29+
or clearing the entire cache with
30+
31+
```shell
32+
dotnet nuget locals --clear all
33+
```
34+
35+
or simply
36+
37+
```shell
38+
make clear_nuget_cache
39+
```
40+
41+
This is done automatically before running `make conformance_tests`
42+
2043
## Release
2144

2245
To release a new version use `changie` to update the changelog file, open a PR for that change. Once that PR merges it will trigger a release workflow.

Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ build::
1212
cd pulumi-language-dotnet && ${GO} build \
1313
-ldflags "-X github.com/pulumi/pulumi-dotnet/pulumi-language-dotnet/version.Version=$(DEV_VERSION)" .
1414

15+
clear_nuget_cache::
16+
dotnet nuget locals --clear all
17+
1518
test_integration:: build
1619
cd integration_tests && gotestsum -- --parallel 1 --timeout 60m ./...
1720

18-
test_conformance:: build
21+
test_conformance:: clear_nuget_cache build
1922
cd pulumi-language-dotnet && gotestsum -- --timeout 60m ./...
2023

2124
.PHONY: install build

pulumi-language-dotnet/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,7 @@ func (host *dotnetLanguageHost) constructEnv(req *pulumirpc.RunRequest, config,
812812
maybeAppendEnv("engine", host.engineAddress)
813813
maybeAppendEnv("organization", req.GetOrganization())
814814
maybeAppendEnv("project", req.GetProject())
815+
maybeAppendEnv("root_directory", req.GetInfo().RootDirectory)
815816
maybeAppendEnv("stack", req.GetStack())
816817
maybeAppendEnv("pwd", req.GetPwd())
817818
maybeAppendEnv("dry_run", fmt.Sprintf("%v", req.GetDryRun()))

0 commit comments

Comments
 (0)