Skip to content

Commit df65048

Browse files
authored
Lint upstream as a normal unit test (#4918)
This removes the last job in `extraTests` by making it a standard unit test. Currently the job runs without caching and takes upwards of 30-40 minutes because it re-compiles everything from scratch. This makes it the long poll when sharding is [turned on](https://github.com/pulumi/pulumi-aws/actions/runs/12321334449). By running with the rest of our tests it can benefit from caching. Locally the test takes only ~20s. This is run during unit tests, which still take about ~5 minutes before and after this change. They're actually slightly faster because I parallelized some of them while I was in here.
1 parent ccd48fb commit df65048

File tree

16 files changed

+110
-58
lines changed

16 files changed

+110
-58
lines changed

.ci-mgmt.yaml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -63,32 +63,3 @@ actions:
6363
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }}
6464
- name: Make upstream
6565
run: make upstream
66-
67-
extraTests:
68-
69-
upstream_lint:
70-
name: Run upstream provider-lint
71-
runs-on: ubuntu-latest
72-
timeout-minutes: 60
73-
steps:
74-
- name: Free Disk Space (Ubuntu)
75-
uses: jlumbroso/free-disk-space@main
76-
with:
77-
swap-storage: false
78-
tool-cache: false
79-
- name: Checkout Repo
80-
uses: actions/checkout@v4
81-
with:
82-
ref: ${{ env.PR_COMMIT_SHA }}
83-
submodules: true
84-
- name: Install Go
85-
uses: actions/setup-go@v5
86-
with:
87-
go-version: "1.23.x"
88-
cache: false
89-
- name: Prepare local workspace
90-
run: make prepare_local_workspace
91-
- name: upstream lint
92-
run: |
93-
cd upstream
94-
make provider-lint

.github/workflows/test.yml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -113,30 +113,3 @@ jobs:
113113
- go
114114
- java
115115
testTarget: [local]
116-
upstream_lint:
117-
name: Run upstream provider-lint
118-
runs-on: ubuntu-latest
119-
steps:
120-
- name: Free Disk Space (Ubuntu)
121-
uses: jlumbroso/free-disk-space@main
122-
with:
123-
swap-storage: false
124-
tool-cache: false
125-
- name: Checkout Repo
126-
uses: actions/checkout@v4
127-
with:
128-
ref: ${{ env.PR_COMMIT_SHA }}
129-
submodules: true
130-
- name: Install Go
131-
uses: actions/setup-go@v5
132-
with:
133-
cache: false
134-
go-version: 1.23.x
135-
- name: Prepare local workspace
136-
run: make prepare_local_workspace
137-
- name: upstream lint
138-
run: |
139-
cd upstream
140-
make provider-lint
141-
timeout-minutes: 60
142-
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Bryce Lampe <[email protected]>
3+
Date: Fri, 13 Dec 2024 13:44:02 -0800
4+
Subject: [PATCH] Speed up providerlint by re-using build cache and ignoring
5+
tests
6+
7+
8+
diff --git a/GNUmakefile b/GNUmakefile
9+
index 9b4adecff8..32137c8919 100644
10+
--- a/GNUmakefile
11+
+++ b/GNUmakefile
12+
@@ -326,9 +326,10 @@ prereq-go: ## If $(GO_VER) is not installed, install it
13+
14+
provider-lint: ## [CI] ProviderLint Checks / providerlint
15+
@echo "make: ProviderLint Checks / providerlint..."
16+
- @cd .ci/providerlint && go install -buildvcs=false .
17+
- @providerlint \
18+
+ @cd .ci/providerlint && go build -buildvcs=false .
19+
+ @.ci/providerlint/providerlint \
20+
-c 1 \
21+
+ -test=false \
22+
-AT001.ignored-filename-suffixes=_data_source_test.go \
23+
-AWSAT006=false \
24+
-AWSR002=false \

provider/cmd/pulumi-tfgen-aws/wafv2_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import (
1010
)
1111

1212
func TestReplaceWafV2TypesWithRecursive(t *testing.T) {
13+
t.Parallel()
14+
1315
spec := schema.PackageSpec{
1416
Types: map[string]schema.ComplexTypeSpec{
1517
// Root statement - keep it.

provider/configure_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import (
2929
)
3030

3131
func TestCheckConfigWithUnknownKeys(t *testing.T) {
32+
t.Parallel()
33+
3234
// Double checking that this is a failure, but no longer over-fitting the test on the exact
3335
// error message. See pulumi/pulumi-terraform-bridge codebase instead for controlling the
3436
// generated error message.
@@ -57,6 +59,8 @@ func TestCheckConfigWithUnknownKeys(t *testing.T) {
5759
}
5860

5961
func TestCheckConfigRunsUpstreamValidators(t *testing.T) {
62+
t.Parallel()
63+
6064
replaySequence(t, strings.ReplaceAll(`
6165
[{
6266
"method": "/pulumirpc.ResourceProvider/CheckConfig",

provider/diag_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import (
1010
)
1111

1212
func TestFormatDiags(t *testing.T) {
13+
t.Parallel()
14+
1315
type testCase struct {
1416
name string
1517
config diag.Diagnostics

provider/diff_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import (
2727
//
2828
// See also pulumi/pulumi-aws#3650.
2929
func TestRegressLandingZoneDiff(t *testing.T) {
30+
t.Parallel()
31+
3032
event := `
3133
[{
3234
"method": "/pulumirpc.ResourceProvider/Diff",
@@ -66,6 +68,8 @@ func TestRegressLandingZoneDiff(t *testing.T) {
6668
}
6769

6870
func TestRegress1738(t *testing.T) {
71+
t.Parallel()
72+
6973
containerDefinitionsOld := `
7074
[
7175
{

provider/enum_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99
)
1010

1111
func TestInstanceTypeName(t *testing.T) {
12+
t.Parallel()
13+
1214
type testCase struct {
1315
Value string
1416
Name string
@@ -34,6 +36,8 @@ func TestInstanceTypeName(t *testing.T) {
3436
}
3537

3638
func TestInstanceTypeNameErr(t *testing.T) {
39+
t.Parallel()
40+
3741
testCases := []string{
3842
"a1.metal.pc",
3943
}

provider/fast_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ func init() {
1010
version.Version = "1.2.4"
1111
}
1212

13-
func TestProvider(_ *testing.T) {
13+
func TestProvider(t *testing.T) {
14+
t.Parallel()
15+
1416
Provider()
1517
}
1618

provider/pkg/batch/compute_environment_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import (
1111
)
1212

1313
func TestComputeEnvironmentTransformFromState(t *testing.T) {
14+
t.Parallel()
15+
1416
ctx := context.Background()
1517
pm := resource.PropertyMap{
1618
"computeResources": resource.NewObjectProperty(resource.PropertyMap{

0 commit comments

Comments
 (0)