pulumi/tests
Fraser Waters c7ed4024ff Support for integers on the wire and state protocol
An exploration into how we could support int64 as well as float64 as a
first class type in Pulumi.

There's some inherit trickiness with this because we use JSON in a few
places, state files most obviously but `PropertyValue` on the wire is
using the protobuf `Struct` and `Value` types which are just mappings to
JSON as well.

JSON doesn't have an int64 type, and while the Go JSON marshaller can
read/write int64s it's not a great behaviour to rely on given mixed
support for that across languages. Further the protobuf `Value` type
only supports float64s.

So we support integers similar to our other special types (like assets)
and wrap them in an object with a special signature field. The value
itself is either a number (if it can safely roundtrip to float64 and
back again) or a string.

Providers, SDKs and the engine communicate support for integers via
`AcceptsIntegers` fields in their interfaces (or similar). When
transmitting to a peer that doesn't support integers (e.g. an old SDK,
or old provider) all integer values are mapped back to standard number
values.

As this changes the serialisation of property values in the state file
it will trigger errors if old engines try to load a state file
containing integers.
2024-08-23 13:36:45 +01:00
..
benchmarks/go-alias-norm Bump go modules (#16051) 2024-04-25 14:30:00 +00:00
examples Update node sdk to use typescript definitions for grpc and protobufs. (#14415) 2023-12-04 15:22:44 +00:00
integration Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
testdata Support for integers on the wire and state protocol 2024-08-23 13:36:45 +01:00
testprovider Add NodeJS test for parameterized providers #2 (#16901) 2024-08-09 08:34:29 +00:00
.gitignore ci: Use reduced smoke testing on Windows & macOS targets 2022-09-21 09:55:06 -07:00
README.md Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
about_test.go Run Environment.DeleteIfNotFailed after tests complete (#16730) 2024-07-23 10:37:01 +00:00
config_test.go [config] Re-enable TestConfigCommandsUsingEnvironments (#16817) 2024-07-30 21:34:14 +00:00
go.mod Changelog and go.mod updates for v3.129.0 (#16947) 2024-08-12 19:28:33 +00:00
go.sum [pkg] Update `github.com/pgavlin/text` (#17041) 2024-08-21 20:59:24 +00:00
history_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
login_test.go ci: radical idea - what if slow tests & no stdout makes GH consider runner dead? 2022-03-06 14:52:13 -08:00
main_test.go Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00
policy_new_test.go Revert "[policy] support premium policies (#13898)" (#14114) 2023-10-06 09:49:40 +00:00
preview_only_test.go Run Environment.DeleteIfNotFailed after tests complete (#16730) 2024-07-23 10:37:01 +00:00
remote_test.go Use new API for deployments (#15684) 2024-04-16 23:23:56 +00:00
roundtrip_test.go Run Environment.DeleteIfNotFailed after tests complete (#16730) 2024-07-23 10:37:01 +00:00
smoke_test.go Get latest version if one not specified in pulumi manifest (#16981) 2024-08-23 08:16:42 +00:00
stack_test.go Run Environment.DeleteIfNotFailed after tests complete (#16730) 2024-07-23 10:37:01 +00:00

README.md

Integration Tests

This module provides integration tests for the Pulumi CLI.

The tests can be run via:

make test_all

Usage of Go build tags

In order to speed up integration tests in GitHub actions, Go build tags are used to conditionally compile the desired test cases.

// integration_nodejs_test.go
//go:build (nodejs || all) && !xplatform-acceptance

// integration_nodejs_acceptance_test.go
//go:build nodejs || all