Commit Graph

25 Commits

Author SHA1 Message Date
Julien 371f7b1bbb
Run Environment.DeleteIfNotFailed after tests complete ()
Ensure we always run `Environment.DeleteIfNotFailed` in our Environment
based tests.

Also standardize on this instead of manually checking with `if t.Failed`
and calling `Environment.DeleteEnvironment()`.
2024-07-23 10:37:01 +00:00
Julien P 91568bc03b
Handle extra CLI arguments passed policy packs plugins ()
The python policy plugin argument parsing was very brittle and would
fail when passed extra flags such as `--tracing <file>` or
`--logtostderr`. We now properly parse these standard plugin falgs (see
plugin#buildPluginArguments). Note that the flags are currently not
being used by the policy plugins.

Nodejs does not suffer from the same issue because we are already using
`minimist` to parse the arguments.

Fixes https://github.com/pulumi/pulumi/issues/11092
2024-06-17 09:10:04 +00:00
Thomas Gummerer 13371f9865
Start policy packs in parallel ()
Currently we start up and thus compile policy packs one by one. When
multiple policy packs need to be loaded, this increases the start up
time substantially. In previous tests plugins took ~1-3s to start up, so
having multiple of these the time adds up quickly.

Loading them in parallel will help reduce the startup time here.

Fixes 

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [x] I have formatted my code using `gofumpt`

<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] 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. -->
2023-11-20 14:08:32 +00:00
Abhinav Gupta 3d64521cf2
unused: Remove unused functions and types
Several functions and types were reported as unused.

Most notably, jsonTemp and the method in jsonSpiller that uses it
were all unused.
2023-01-12 09:55:34 -08:00
Aaron Friel a4b1d6b2a7 ci: gofmt 1.18+ clean 2022-09-21 09:48:39 -07:00
Eng Zer Jun 19d84ef1f3
test: use `T.Setenv` to set env vars in tests ()
This commit replaces `os.Setenv` with `t.Setenv` in tests. The
environment variable is automatically restored to its original value
when the test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.Setenv
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-07-24 10:41:44 +01:00
Aaron Friel ed2923653c ci: radical idea - what if slow tests & no stdout makes GH consider runner dead? 2022-03-06 14:52:13 -08:00
Horace Lee a92a005d68
Use ESlint instead of TSlint ()
Migrated TSlint configs to ESlint ones using [tslint-to-eslint-config](https://github.com/typescript-eslint/tslint-to-eslint-config) tool, and refined the configs to better match the current coding style.

Changes:
- [member-delimiter-style](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/member-delimiter-style.md#options) that as suggested default for type definition to be  with `semicolon`
- Indentation fixes that is enforced by [eslint-indent](https://eslint.org/docs/rules/indent#options)
- Added dependencies for ESlint with Typescript
- Removed TSlint
2021-08-10 11:31:59 -07:00
pulumi-bot 73a66f48ea [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
Justin Van Patten a5a6863f57
Update `@pulumi/policy` dependency ()
The test that uses these are currently disabled -- but still wanted to make sure we didn't forget to update.
2020-04-18 13:07:19 -07:00
CyrusNajmabadi 66bd3f4aa8
Breaking changes due to Feature 2.0 work
* Make `async:true` the default for `invoke` calls ()

* Switch away from native grpc impl. ()

* Remove usage of the 'deasync' library from @pulumi/pulumi. ()

* Only retry as long as we get unavailable back.  Anything else continues. ()

* Handle all errors for now. ()


* Do not assume --yes was present when using pulumi in non-interactive mode ()

* Upgrade all paths for sdk and pkg to v2

* Backport C# invoke classes and other recent gen changes ()

Adjust C# generation

* Replace IDeployment with a sealed class ()

Replace IDeployment with a sealed class

* .NET: default to args subtype rather than Args.Empty ()

* Adding system namespace for Dotnet code gen

This is required for using Obsolute attributes for deprecations

```
Iam/InstanceProfile.cs(142,10): error CS0246: The type or namespace name 'ObsoleteAttribute' could not be found (are you missing a using directive or an assembly reference?) [/Users/stack72/code/go/src/github.com/pulumi/pulumi-aws/sdk/dotnet/Pulumi.Aws.csproj]
Iam/InstanceProfile.cs(142,10): error CS0246: The type or namespace name 'Obsolete' could not be found (are you missing a using directive or an assembly reference?) [/Users/stack72/code/go/src/github.com/pulumi/pulumi-aws/sdk/dotnet/Pulumi.Aws.csproj]
```

* Fix the nullability of config type properties in C# codegen ()
2020-04-14 09:30:25 +01:00
Justin Van Patten 938e25164c
Update `@pulumi/policy` dependency () 2020-04-10 11:25:58 -07:00
Justin Van Patten 89ce65fcd8
Skip policy tests that cause concurrent Travis jobs to fail () 2020-04-02 15:45:00 -07:00
Justin Van Patten efa5237598
Fix policy integration test dependencies ()
And remove some other unnecessary cruft while cleaning things up here.
2020-03-29 17:55:08 -07:00
Sean Holung fa3d50faa2
Remove pulumi/aws dependency from policy int tests () 2020-03-27 14:55:58 -07:00
Sean Holung 7b91dc20a8
Add cmd to support policy pack config validation ()
* Add cmd `pulumi policy validate-config` to do policy pack config validation
2020-03-27 09:54:26 -07:00
Luke Hoban 2ada63ef4e
Fix versions of dependencies in policy tests ()
These were causing *very* old versions of `@pulumi/pulumi` to get pulled in, and were seeing failures on Node 13 due to missnig gRPC native modules.

Aside - we've tried to not have any dependencies in `@pulumi/pulumi` on `@pulumi/aws` and other higher-level libraries, to avoid layering violation issues.  Would love to see if we can reasonably simplify the testing at this layer to not have this dependency.
2020-03-25 09:35:41 -07:00
Sean Holung d0f5e35b50
Add support for enabling Policy Packs with configuration ()
* Support policy pack configiguration using policy enable cmd.
2020-03-24 13:30:36 -07:00
Justin Van Patten f095e64d0f
Temporarily skip test causing unrelated failures in master () 2020-03-21 12:37:42 -07:00
evanboyle a4ec3ec81b move pkg/testing -> sdk/go/common/testing, leave behind pkg/testing/integration 2020-03-18 15:55:41 -07:00
Erin Krengel e660937bab
use version tag () 2020-02-24 17:11:56 -08:00
Erin Krengel 232d798189
Add remove all to policy () 2020-01-27 10:35:34 -08:00
Erin Krengel 0d0641278c
Remove version req for disable; Add --latest to enable () 2020-01-22 15:17:00 -08:00
Erin Krengel 223e0c5e83
Add policy ls () 2020-01-16 12:04:51 -08:00
Erin Krengel 0ba101fdba
Improvements to pulumi policy () 2020-01-03 14:16:39 -08:00