Skip to content

Commit cc541d6

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 05c1cfa commit cc541d6

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
@@ -15,10 +15,13 @@ build::
1515
changelog::
1616
changie new
1717

18+
clear_nuget_cache::
19+
dotnet nuget locals --clear all
20+
1821
test_integration:: build
1922
cd integration_tests && gotestsum -- --parallel 1 --timeout 60m ./...
2023

21-
test_conformance:: build
24+
test_conformance:: clear_nuget_cache build
2225
cd pulumi-language-dotnet && gotestsum -- --timeout 60m ./...
2326

2427
# Relative paths to directories with go.mod files that should be linted.

pulumi-language-dotnet/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,7 @@ func (host *dotnetLanguageHost) constructEnv(req *pulumirpc.RunRequest, config,
814814
maybeAppendEnv("engine", host.engineAddress)
815815
maybeAppendEnv("organization", req.GetOrganization())
816816
maybeAppendEnv("project", req.GetProject())
817+
maybeAppendEnv("root_directory", req.GetInfo().RootDirectory)
817818
maybeAppendEnv("stack", req.GetStack())
818819
maybeAppendEnv("pwd", req.GetPwd())
819820
maybeAppendEnv("dry_run", strconv.FormatBool(req.GetDryRun()))

0 commit comments

Comments
 (0)