Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: golangci/golangci-lint-action@v9
with:
# renovate: datasource=go depName=github.com/golangci/golangci-lint
version: 'v2.11.4'
version: 'v2.12.2'

unit-test:
runs-on: ubuntu-24.04
Expand Down
14 changes: 8 additions & 6 deletions fn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ func TestRunFunction(t *testing.T) {
err error
}

const tagHello = "hello"

cases := map[string]struct {
reason string
args args
Expand All @@ -35,7 +37,7 @@ func TestRunFunction(t *testing.T) {
reason: "The Function requires more external resources",
args: args{
req: &fnv1.RunFunctionRequest{
Meta: &fnv1.RequestMeta{Tag: "hello"},
Meta: &fnv1.RequestMeta{Tag: tagHello},
Input: resource.MustStructJSON(`{
"apiVersion": "s3-user-arn.fn.crossplane.io/v1alpha1",
"kind": "Input"
Expand Down Expand Up @@ -74,7 +76,7 @@ func TestRunFunction(t *testing.T) {
},
want: want{
rsp: &fnv1.RunFunctionResponse{
Meta: &fnv1.ResponseMeta{Tag: "hello", Ttl: durationpb.New(response.DefaultTTL)},
Meta: &fnv1.ResponseMeta{Tag: tagHello, Ttl: durationpb.New(response.DefaultTTL)},
Context: resource.MustStructJSON(`{
"apiextensions.crossplane.io/environment": {
"tenantName": "tenant"
Expand Down Expand Up @@ -104,7 +106,7 @@ func TestRunFunction(t *testing.T) {
reason: "The Function should return a successful result if sufficient resources are provided",
args: args{
req: &fnv1.RunFunctionRequest{
Meta: &fnv1.RequestMeta{Tag: "hello"},
Meta: &fnv1.RequestMeta{Tag: tagHello},
Input: resource.MustStructJSON(`{
"apiVersion": "s3-user-arn.fn.crossplane.io/v1alpha1",
"kind": "Input"
Expand Down Expand Up @@ -163,7 +165,7 @@ func TestRunFunction(t *testing.T) {
},
want: want{
rsp: &fnv1.RunFunctionResponse{
Meta: &fnv1.ResponseMeta{Tag: "hello", Ttl: durationpb.New(response.DefaultTTL)},
Meta: &fnv1.ResponseMeta{Tag: tagHello, Ttl: durationpb.New(response.DefaultTTL)},
Context: resource.MustStructJSON(`{
"apiextensions.crossplane.io/environment": {
"tenantName": "tenant"
Expand Down Expand Up @@ -209,7 +211,7 @@ func TestRunFunction(t *testing.T) {
reason: "The Function should return a successful result if sufficient resources are provided",
args: args{
req: &fnv1.RunFunctionRequest{
Meta: &fnv1.RequestMeta{Tag: "hello"},
Meta: &fnv1.RequestMeta{Tag: tagHello},
Input: resource.MustStructJSON(`{
"apiVersion": "s3-user-arn.fn.crossplane.io/v1alpha1",
"kind": "Input"
Expand Down Expand Up @@ -270,7 +272,7 @@ func TestRunFunction(t *testing.T) {
},
want: want{
rsp: &fnv1.RunFunctionResponse{
Meta: &fnv1.ResponseMeta{Tag: "hello", Ttl: durationpb.New(response.DefaultTTL)},
Meta: &fnv1.ResponseMeta{Tag: tagHello, Ttl: durationpb.New(response.DefaultTTL)},
Context: resource.MustStructJSON(`{
"apiextensions.crossplane.io/environment": {
"tenantName": "tenant"
Expand Down
Loading