78c48204e0
Normalize methods on plugin.Provider to the form: ```go Method(context.Context, MethodRequest) (MethodResponse, error) ``` This provides a more consistent and forwards compatible interface for each of our methods. --- I'm motivated to work on this because the bridge maintains a copy of this interface: `ProviderWithContext`. This doubles the pain of dealing with any breaking change and this PR would allow me to remove the extra interface. I'm willing to fix consumers of `plugin.Provider` in `pulumi/pulumi`, but I wanted to make sure that we would be willing to merge this PR if I get it green. <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Fixes # (issue) ## Checklist - [ ] I have run `make tidy` to update any new dependencies - [ ] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [ ] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. --> |
||
---|---|---|
.. | ||
providers | ||
testdata | ||
README.md | ||
go.mod | ||
go.sum | ||
interface.go | ||
interface_test.go | ||
internal_test.go | ||
l1empty_test.go | ||
l1main_test.go | ||
l2continue_on_error_test.go | ||
l2destroy_test.go | ||
l2large_test.go | ||
l2resourceasset_test.go | ||
l2resourcesimple_test.go | ||
main.go | ||
runtime_options_test.go | ||
snapshot_test.go | ||
snapshots.go | ||
testing.go | ||
tests.go |
README.md
pulumi-language-test runs a gRPC interface that language plugins can use to run a suite of standard tests.
Architecture
pulumi-language-test is used to run a standard suite of tests against any compliant language plugin.
The diagram below shows the main interactions and data flows for how this system works.
There are three main actors involved. Firstly test
which is a test function coordinating the language plugin and pulumi-language-test. Secondly ptl
which is the pulumi-language-test process. Finally uut
which is the language plugin actually being tested. This will generally be a grpc server running in the same process as the test method.
sequenceDiagram
test->>ptl: Start ptl process
ptl-->>test: Read stdout for ptl address to connect to
Note right of test: All future calls to ptl are via grpc
test->>+ptl: GetLanguageTests()
ptl-->>-test: Returns list of test names
test->>+uut: Serve
uut-->>-test: Returns uut server address
test->>+ptl: PrepareLanguageTests(uut)
ptl->>+uut: Pack(core)
uut-->>-ptl: Returns name of core artifact
ptl-->>-test: Returns `token`
loop for each test
test->>+ptl: RunLanguageTest(token, test)
loop for each sdk used in test
ptl->>+uut: GeneratePackage(sdk)
uut-->>-ptl: Write package code to temporary directory
ptl->>ptl: Verify sdk snapshot
ptl->>+uut: Pack(sdk)
uut-->>-ptl: Returns name of sdk artifact
end
ptl->>+uut: GenerateProject(test)
uut-->>-ptl: Write project code to temporary directory
ptl->>ptl: Verify project snapshot
ptl->>+uut: InstallDependencies(project)
uut-->>-ptl:
note right of ptl: Execute test with engine
activate ptl
ptl->>+uut: Run(project)
uut-->>-ptl: Return run result
ptl->>ptl: Run test asserts against run result and snapshot
deactivate ptl
ptl-->>-test: Returns test result from asserts
end
test->>ptl: sigkill
Meta tests
This module contains a number of _test.go
files. These are tests of the conformance test system itself. The actual conformance tests are all defined in tests.go
.