Skip to content

Commit

Permalink
Revert irrelevant changes
Browse files Browse the repository at this point in the history
  • Loading branch information
VenelinMartinov committed Jan 13, 2025
1 parent 17ad2ad commit b4abd70
Show file tree
Hide file tree
Showing 7 changed files with 1,118 additions and 54 deletions.
68 changes: 19 additions & 49 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,67 +22,41 @@ jobs:
go-version: [1.22.x, 1.23.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
feature-flags: ["DEFAULT", "PULUMI_TF_BRIDGE_ACCURATE_BRIDGE_PREVIEW"]
shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
exclude:
shard: [0]
include:
- platform: windows-latest
feature-flags: "PULUMI_TF_BRIDGE_ACCURATE_BRIDGE_PREVIEW"
- platform: macos-latest
feature-flags: "PULUMI_TF_BRIDGE_ACCURATE_BRIDGE_PREVIEW"
- platform: windows-latest
shard: 1
- platform: windows-latest
shard: 2
- platform: windows-latest
shard: 3
- platform: windows-latest
shard: 4
- platform: windows-latest
shard: 5
- platform: windows-latest
shard: 6
- platform: windows-latest
shard: 7
- platform: windows-latest
shard: 8
- platform: windows-latest
shard: 9
- platform: windows-latest
shard: 10
- platform: windows-latest
shard: 11
- platform: windows-latest
shard: 12
- platform: windows-latest
shard: 13
- platform: windows-latest
shard: 14
- platform: macos-latest
# The 0-th shard is run on all platforms and on ubuntu-latest
# we also run the other shards.
- platform: ubuntu-latest
shard: 1
- platform: macos-latest
- platform: ubuntu-latest
shard: 2
- platform: macos-latest
- platform: ubuntu-latest
shard: 3
- platform: macos-latest
- platform: ubuntu-latest
shard: 4
- platform: macos-latest
- platform: ubuntu-latest
shard: 5
- platform: macos-latest
- platform: ubuntu-latest
shard: 6
- platform: macos-latest
- platform: ubuntu-latest
shard: 7
- platform: macos-latest
- platform: ubuntu-latest
shard: 8
- platform: macos-latest
- platform: ubuntu-latest
shard: 9
- platform: macos-latest
- platform: ubuntu-latest
shard: 10
- platform: macos-latest
- platform: ubuntu-latest
shard: 11
- platform: macos-latest
- platform: ubuntu-latest
shard: 12
- platform: macos-latest
- platform: ubuntu-latest
shard: 13
- platform: macos-latest
- platform: ubuntu-latest
shard: 14
runs-on: ${{ matrix.platform }}
steps:
Expand All @@ -99,22 +73,18 @@ jobs:
cache-dependency-path: |
**/go.sum
# disable caching on windows because it's very slow
# see https://github.com/actions/setup-go/issues/495
cache: ${{ matrix.platform != 'windows-latest' }}
- name: export feature flags
run: echo ${{ matrix.feature-flags }}=true >> $GITHUB_ENV
if: ${{ matrix.platform != 'windows-latest' && matrix.feature-flags != 'DEFAULT' }}
- name: export feature flags
run: echo ${{ matrix.feature-flags }}=true >> $env:GITHUB_ENV
if: ${{ matrix.platform == 'windows-latest' && matrix.feature-flags != 'DEFAULT' }}
- name: Build
run: make build
- name: Build PF
run: cd pkg/pf && make build
- name: Shard tests
run: echo "SHARD_CMD=$(go run github.com/VenelinMartinov/sharder@9d09afeb1c053b4a0263fbaa5c3c9da1ca2d10e7 --total ${{ env.TOTAL_SHARDS }} --index ${{ matrix.shard }} --output testoutput.txt --format make)" >> $GITHUB_ENV
if: ${{ matrix.platform == 'ubuntu-latest' }}
- run: echo "$SHARD_CMD"
if: ${{ matrix.platform == 'ubuntu-latest' }}
- name: Test
run: make VERBOSE=true test_shard
if: ${{ matrix.platform == 'ubuntu-latest' }}
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ testing/coverage.txt
pf/coverage.out
pf/tests/coverage.out

pulumi-hcl-lint

schema-tpsdkv2.json
pulumi-hcl-lint
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ test:: install_plugins
PULUMI_TERRAFORM_BRIDGE_TEST_PROVIDER=$(shell pwd)/bin/pulumi-terraform-bridge-test-provider \
go test -count=1 -coverprofile="coverage.txt" -coverpkg=./... -timeout 2h -parallel ${TESTPARALLELISM} ./...

# Run a single shard of tests. This is a make target for use in CI. It assumes the shard arguments are provided in SHARD_CMD
test_shard:: install_plugins
@mkdir -p bin
go build -o bin ./internal/testing/pulumi-terraform-bridge-test-provider
PULUMI_TERRAFORM_BRIDGE_TEST_PROVIDER=$(shell pwd)/bin/pulumi-terraform-bridge-test-provider \
go test -count=1 -coverprofile="coverage.txt" -coverpkg=./... -timeout 2h -parallel ${TESTPARALLELISM} ./... ${SHARD_CMD}

# Run the tests and record profiling data. This is used for partitioning tests into shards for CI.
test_profile:: install_plugins
@mkdir -p bin
go build -o bin ./internal/testing/pulumi-terraform-bridge-test-provider
Expand Down
2 changes: 1 addition & 1 deletion pkg/pf/tests/provider_configure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ func TestConfigureBooleans(t *testing.T) {
}`)
}

func TestConfigureErrorReplacementPF(t *testing.T) {
func TestConfigureErrorReplacement(t *testing.T) {
t.Parallel()
t.Run("replace_config_properties", func(t *testing.T) {
errString := `some error with "config_property" and "config" but not config`
Expand Down
2 changes: 1 addition & 1 deletion pkg/tfbridge/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1988,7 +1988,7 @@ func TestConfigure(t *testing.T) {
})
}

func TestConfigureErrorReplacementSDKv2(t *testing.T) {
func TestConfigureErrorReplacement(t *testing.T) {
t.Parallel()
t.Run("replace_config_properties", func(t *testing.T) {
p := testprovider.ProviderV2()
Expand Down
Loading

0 comments on commit b4abd70

Please sign in to comment.