pulumi/sdk
Julien 43a9bd7fe6
Catch BaseException in automation API server (#17909)
Automation API is useful for writing tests for Pulumi programs, and a
user could write a test as follows:

```python
def program():
    with pytest.raises(ValueError):
        _a = 1 + 2  # No error here, pytest.raises should fail

stack = create_stack("mystack", program=program, project_name="proj")

with pytest.raises(InlineSourceRuntimeError):
    stack.preview()
```

If the block in `pytest.raises` does not raise the expected error or any
error, `pytest.raises` fails the test by raising an `OutcomeException`.
This exception class inherits from `BaseException`, not `Exception`, so
we would previously not catch this, and fail to report an error from the
automation API server's `Run` method, causing the call to
`stack.preview`
to hang indefinitely.

Fixes https://github.com/pulumi/pulumi/issues/17133
2024-12-03 15:47:58 +00:00
..
go Add GetRequiredPackages to the language host (#17894) 2024-12-02 20:24:23 +00:00
nodejs Don't hang indefinitely on failed inputs (#17899) 2024-12-03 10:18:25 +00:00
proto/go Add GetRequiredPackages to the language host (#17894) 2024-12-02 20:24:23 +00:00
python Catch BaseException in automation API server (#17909) 2024-12-03 15:47:58 +00:00
.version Freeze v3.142.0 (#17873) 2024-11-26 15:46:25 +00:00
README.md Cleanup sdk/README.md 2023-01-03 17:12:12 -05:00
go.mod fix dll loading errors in windows CI (#17410) 2024-10-02 08:43:42 +00:00
go.sum fix dll loading errors in windows CI (#17410) 2024-10-02 08:43:42 +00:00
version.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00

README.md

Pulumi Language SDKs

This directory contains Pulumi SDKs for the following languages:

See the respective READMEs for information about installing and using these libraries.

The language providers work by implementing gRPC interfaces defined in the top level directory proto.