Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing Improvements #127

Merged
merged 35 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
33ce804
ci: add basic pipelines
gene-redpanda Aug 2, 2024
e2675cf
feat: examples rework
gene-redpanda Aug 5, 2024
778a043
feat: add cloudprovider validation for links
gene-redpanda Aug 5, 2024
e478f74
feat: consolidated testing code
gene-redpanda Aug 6, 2024
687c9f1
fix: remove testing value
gene-redpanda Aug 6, 2024
d7b2c67
fix: corrected secret location
gene-redpanda Aug 6, 2024
c2f6832
fix: corrected secret location
gene-redpanda Aug 6, 2024
fe157c8
feat: add throughput tier validator
gene-redpanda Aug 7, 2024
a0e080a
Merge branch 'add-testing-improvements' of https://github.com/redpand…
gene-redpanda Aug 7, 2024
4cdc8db
feat: add mocks and unit tests
gene-redpanda Aug 9, 2024
36ae789
docs: regen for examples moves
gene-redpanda Aug 9, 2024
29bb9ee
fix: fix test, cleanup func
gene-redpanda Aug 12, 2024
2f565d3
test: isnilmtls tests
gene-redpanda Aug 12, 2024
588965a
chore: move supporting functions to separate file
gene-redpanda Aug 12, 2024
6730e10
feat: make changes to support local testing
gene-redpanda Aug 13, 2024
588ef81
fix: persistent quote issue
gene-redpanda Aug 13, 2024
b4fd68f
chore: make ready
gene-redpanda Aug 13, 2024
acd2228
feat: make and pipeline changes
gene-redpanda Aug 14, 2024
77ed6cf
ci: remove lint github action
gene-redpanda Aug 14, 2024
e08cf65
fix: return nil not empty map
gene-redpanda Aug 14, 2024
cc4589b
fix: sort slices from test
gene-redpanda Aug 14, 2024
2860c71
lint: linter fixes
gene-redpanda Aug 14, 2024
addf07d
fix: force latest install pack for gcp
gene-redpanda Aug 15, 2024
7361774
lint: various lintfile issues
gene-redpanda Aug 16, 2024
fff0d8a
chore: gitignore
gene-redpanda Aug 16, 2024
0e69887
feat: datasource support in makefile
gene-redpanda Aug 16, 2024
780c089
chore: clean up makefile
gene-redpanda Aug 17, 2024
caa1509
doc: updated the readme
gene-redpanda Aug 17, 2024
8cea4e5
fix: switch back to hashicorp
gene-redpanda Aug 22, 2024
2203ea3
fix: default ign
gene-redpanda Aug 22, 2024
ebefbe3
doc: improve documentation for make standup
gene-redpanda Sep 4, 2024
5125165
fix: bug in referencing directory for datasource
gene-redpanda Sep 6, 2024
c07a3e6
feat: make tf_log configurable
gene-redpanda Sep 10, 2024
2720bd8
feat: update buildkite to make tests conditional on label
gene-redpanda Sep 10, 2024
89c6578
fix: error on nil value in topicconfig
gene-redpanda Sep 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
agents:
queue: k8s-builders

steps:
- label: lint
key: lint
command: make lint
plugins:
- docker#v5.11.0:
image: "golang:1.22"
environment:
- BUILDKITE=true
- label: unit
key: unit
command: make unit
plugins:
- docker#v5.11.0:
image: "golang:1.22"
depends_on:
- lint
gene-redpanda marked this conversation as resolved.
Show resolved Hide resolved

- label: test_network
key: test_network
if: build.pull_request.labels includes 'ci-ready'
command: make test_network
plugins:
- seek-oss/aws-sm#v2.3.2:
json-to-env:
- secret-id: sdlc/prod/buildkite/integration_provider_secret_redpanda_client
- docker#v5.11.0:
image: "golang:1.22"
environment:
- INTEGRATION_PROVIDER_SECRET_REDPANDA_CLIENT_ID
- INTEGRATION_PROVIDER_SECRET_REDPANDA_CLIENT_SECRET
depends_on:
- lint
- unit
- label: test_cluster_aws
key: test_cluster_aws
if: build.pull_request.labels includes 'ci-ready'
command: make test_cluster_aws
plugins:
- seek-oss/aws-sm#v2.3.2:
json-to-env:
- secret-id: sdlc/prod/buildkite/integration_provider_secret_redpanda_client
- docker#v5.11.0:
image: "golang:1.22"
environment:
- INTEGRATION_PROVIDER_SECRET_REDPANDA_CLIENT_ID
- INTEGRATION_PROVIDER_SECRET_REDPANDA_CLIENT_SECRET
depends_on:
- lint
- unit
- test_network
- label: test_cluster_azure
key: test_cluster_azure
if: build.pull_request.labels includes 'ci-ready'
command: make test_cluster_azure
plugins:
- seek-oss/aws-sm#v2.3.2:
json-to-env:
- secret-id: sdlc/prod/buildkite/integration_provider_secret_redpanda_client
- docker#v5.11.0:
image: "golang:1.22"
environment:
- INTEGRATION_PROVIDER_SECRET_REDPANDA_CLIENT_ID
- INTEGRATION_PROVIDER_SECRET_REDPANDA_CLIENT_SECRET
depends_on:
- lint
- unit
- test_network
- label: test_cluster_gcp
key: test_cluster_gcp
if: build.pull_request.labels includes 'ci-ready'
command: make test_cluster_gcp
plugins:
- seek-oss/aws-sm#v2.3.2:
json-to-env:
- secret-id: sdlc/prod/buildkite/integration_provider_secret_redpanda_client
- docker#v5.11.0:
image: "golang:1.22"
environment:
- INTEGRATION_PROVIDER_SECRET_REDPANDA_CLIENT_ID
- INTEGRATION_PROVIDER_SECRET_REDPANDA_CLIENT_SECRET
depends_on:
- lint
- unit
- test_network
- label: test_serverless_cluster
key: test_serverless_cluster
if: build.pull_request.labels includes 'ci-ready'
command: make test_serverless_cluster
plugins:
- seek-oss/aws-sm#v2.3.2:
json-to-env:
- secret-id: sdlc/prod/buildkite/integration_provider_secret_redpanda_client
- docker#v5.11.0:
image: "golang:1.22"
environment:
- INTEGRATION_PROVIDER_SECRET_REDPANDA_CLIENT_ID
- INTEGRATION_PROVIDER_SECRET_REDPANDA_CLIENT_SECRET
depends_on:
- lint
- unit
- test_network
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Run make command
run: make doc

Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/lint-golang.yml

This file was deleted.

13 changes: 4 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# Terraform Provider release workflow.
name: Release

# This GitHub action creates a release when a tag that matches the pattern
# "v*" (e.g. v0.1.0) is created.
on:
push:
tags:
- 'v*'

# Releases need permissions to read and write the repository contents.
# GitHub considers creating releases and uploading assets as writing contents.
permissions:
contents: write

Expand All @@ -29,22 +24,22 @@ jobs:
secret-ids: |
,sdlc/prod/github/tf_provider_rp
parse-json-secrets: true
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@v4
with:
# Allow goreleaser to access older tag information.
fetch-depth: 0
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@82a020f1f7f605c65dd2449b392a52c3fcfef7ef # v6.0.0
uses: crazy-max/ghaction-import-gpg@v6
id: import_gpg
with:
gpg_private_key: ${{ env.TF_PROVIDER_RP_GPG_PRIVATE_KEY }}
passphrase: ${{ env.TF_PROVIDER_RP_PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
uses: goreleaser/goreleaser-action@v6
with:
args: release --clean
env:
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@ terraform-provider-redpanda
tools/tfplugindocs

.idea/**

**.terraform.d**
**.terraform**
**terraform.tfstate**
**terraform.tfstate.backup**
terraform-provider-hashicorp
**/.tmp_*
.cluster_info*
26 changes: 0 additions & 26 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
run:
allow-parallel-runners: true
skip-dirs:
- proto

# golangci-lint by default ignores some staticcheck and vet raised issues that
# are actually important to catch. The following ensures that we do not ignore
# those tools ever.
issues:
exclude-use-default: false
exclude-rules:
- linters:
- goconst
text: "string `UNSPECIFIED` has"
path: redpanda/utils/utils.go
- linters:
- goconst
text: "string `ANY` has"
path: redpanda/utils/utils.go
- linters:
- goconst
text: "string `UNKNOWN` has"
path: redpanda/utils/utils.go
- path: _test\.go
linters:
- gocognit
Expand Down Expand Up @@ -93,20 +79,13 @@ linters-settings:
require-explanation: true
require-specific: true

# If gofumpt is run outside a module, it assumes Go 1.0 rather than the
# latest Go. We always want the latest formatting.
#
# https://github.com/mvdan/gofumpt/issues/137
gofumpt:
lang-version: "1.21"
cyclop:
max-complexity: 20
gocyclo:
min-complexity: 30
gocognit:
min-complexity: 30
gci:
no-prefix-comments: true # no leading comment; we allow inline for nolint
sections:
- standard # stdlib
- default # everything not std, not within cloudv2
Expand All @@ -127,18 +106,13 @@ linters-settings:
- importShadow
# disabled due to 1.18 failures
- hugeParam
- rangeValCopy
- typeDefFirst
- paramTypeCombine
# Revive is yet another metalinter with a lot of useful lints.
# The below opts in to all the ones we would like to use.
revive:
ignore-generated-header: true
enable-all-rules: true
severity: warning
confidence: 0.7
error-code: 1
warning-code: 1
rules:
- name: add-constant
disabled: true
Expand Down
Loading