Commit Graph

8 Commits

Author SHA1 Message Date
Abhinav Gupta 362cc2a41a
sdk/go: Add pulumix subpackage ()
**Each commit is separately reviewable.**

---

Adds the pulumix subpackage implementing strongly-typed
inputs, outputs, and combinators.
internal/cmd/gen-pux-applyn generates all four variants of `Apply` for
up to 8 parameters.

See individual commits for more details on each change.

Resolves 
2023-08-28 15:38:23 +00:00
Abhinav Gupta 6af5f0b39d
ci: Track code coverage
**Overview**

This re-enables tracking of code coverage.
For Go, there are two kinds of coverage at play:
unit test and integration test coverage.

Unit tests follow the usual pattern of running
`go test -cover -coverprofile=whatever.cov`.

For integration tests, we use the new integration test profiling support
[added in Go 1.20](https://go.dev/testing/coverage/).
In short, the way it works is:

    # Build a coverage instrumented binary:
    go build -cover

    # Set GOCOVERDIR to a directory and run the integration tests
    # that will invoke this coverage-instrumented binary.
    GOCOVERDIR=$(pwd)/coverage
    go test ./tests

    # $GOCOVERDIR will now be filled with coverage data
    # from every invocation of the coverage-instrumented binary.
    # Combine it into a single coverage file:
    go tool covdata textfmt -i=$(GOCOVERDIR) -o=out.cov

    # The resulting file can be uploaded to codecov as-is.

The above replaces the prior, partially working hacks we had in place
to get coverage-instrumented binaries with `go test -c`
and hijacking the TestMain.

**Notable changes**

- TestMain hijacking is deleted from the Pulumi CLI.
  We no longer need this to build coverage-instrumented binaries.
- ProgramTest no longer tracks or passes PULUMI_TEST_COVERAGE_PATH
  because the Pulumi binary no longer accepts a test.coverprofile flag.
  This information is now in the GOCOVERDIR environment variable.
- We add an `enable-coverage` parameter to the `ci-build-binaries`
  workflow to mirror some of the other workflows.
  It will produce coverage-instrumented binaries if this is true.
  These binaries are then used by `ci-run-test` which will set
  `GOCOVERDIR` and merge the coverage results from it.
- Coverage configuration no longer counts tests, testdata,
  and Protobuf-generated code against coverage.
- go-wrapper.sh:
  Because we're no longer relying on the `go test -c` hack,
  this no longer excludes Windows and language providers
  from coverage tracking.
- go-test.py and go-wrapper.sh will include pulumi-language-go and
  pulumi-language-nodejs in covered packages.

*Other changes*

- go-test.py:
  Fixed a bug where `args` parameters added for coverage were ignored.

Note that this change DOES NOT track coverage for calls made to Pulumi
packages by plugins downloaded from external sources,
e.g. provider plugins. Arguably, that's out of scope of coverage
trackcing for the Pulumi repository.

Resolves , 
2023-06-28 13:30:13 -07:00
Fraser Waters f4ad5c5a56 Remove dotnet 2022-12-13 16:13:53 +00:00
Pat Gavlin 0792f7da96
[codecov] Disable the coverage comment. ()
The data displayed in the coverage comment is not particularly useful
due to instability in our coverage results. That instability is inherent
in the way that our tests run. Most notably, tests take a different amount
of time from run-to-run (which causes changes in e.g. spinner coverage),
and some tests process different input data (this is primarily associated
with property-based tests). Because the coverage comment displays all
changes to coverage rather than only those that are associated with the
changed lines, the comment may make it appear that a PR affects the
coverage of certain files that it does not.
2022-02-14 09:49:41 -08:00
Pat Gavlin d3ceb7d39f [codecov] Fix project names + paths.
Per the [Codecov documentation](), changes to a repository's
configuration may not be reflected if the configuration is invalid.
There is a [documented endpoint](https://docs.codecov.com/docs/codecov-yaml#validate-your-repository-yaml)
that can be used to validate Codecov configuration, which indicated some
problems with our config. These changes correct those issues and add a
Makefile target that can be used to validate the config when making
changes.
2022-01-10 14:06:15 -08:00
Pat Gavlin 3715afa590
[codecov] Split results into projects. ()
Take advantage of [Codecov's support for
subprojects](https://github.com/pulumi/pulumi/pull/8685)
to split the results for this repo into results for the CLI/core
packages and each SDK.
2022-01-10 13:37:42 -08:00
Pat Gavlin 968f6596d9
[ci] Disable coverage annotations. () 2022-01-06 15:44:17 -08:00
Pat Gavlin c33f88b828
[ci] Switch code coverage status to informational. ()
Until we've figured out why we seem to be seeing inaccurate code
coverage information (e.g. the status checks on ), make the code
coverage statuses informational.

Related to .
2022-01-05 13:13:59 -08:00