Skip to content

Commit

Permalink
Merge pull request #5 from theopenlane/fix-failing-tests
Browse files Browse the repository at this point in the history
fix failing tests
  • Loading branch information
golanglemonade authored Aug 28, 2024
2 parents d69f303 + 7b10517 commit a3ea770
Show file tree
Hide file tree
Showing 6 changed files with 236 additions and 13 deletions.
17 changes: 9 additions & 8 deletions .buildkite/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ steps:
key: "lint"
plugins:
- docker#v5.11.0:
image: "registry.hub.docker.com/golangci/golangci-lint:v1.59.1"
image: "golangci/golangci-lint:latest-alpine"
command: ["golangci-lint", "run", "-v", "--timeout", "10m", "--config", ".golangci.yaml", "--concurrency", "0"]
always_pull: true
environment:
- "GOTOOLCHAIN=auto"
- label: ":golang: go test - libsql"
Expand Down Expand Up @@ -156,7 +157,7 @@ steps:
- label: ":postgres: atlas lint"
key: "atlas_lint"
plugins:
- theopenlane/atlas#v0.0.3:
- theopenlane/atlas#v1.0.0:
project: core
dev-url: "docker://postgres/16/dev?search_path=public"
dir: "file://db/migrations"
Expand All @@ -165,7 +166,7 @@ steps:
if: build.branch == "main"
key: "atlas_migrate"
plugins:
- theopenlane/atlas#v0.0.3:
- theopenlane/atlas#v1.0.0:
project: core
dev-url: "docker://postgres/16/dev?search_path=public"
dir: "file://db/migrations"
Expand All @@ -187,7 +188,7 @@ steps:
- "${IMAGE_REPO}"
extra_tags:
- "${IMAGE_TAG}"
- theopenlane/container-build#v1.1.0:
- theopenlane/container-build#v1.0.0:
dockerfile: docker/Dockerfile
push: false
build-args:
Expand All @@ -214,7 +215,7 @@ steps:
- "${IMAGE_REPO}"
extra_tags:
- "${IMAGE_TAG}"
- theopenlane/container-build#v1.1.0:
- theopenlane/container-build#v1.0.0:
dockerfile: docker/Dockerfile
push: true
build-args:
Expand All @@ -241,7 +242,7 @@ steps:
- "${GCR_REPO}"
extra_tags:
- "${IMAGE_TAG}"
- theopenlane/container-build#v1.1.0:
- theopenlane/container-build#v1.0.0:
dockerfile: docker/all-in-one/Dockerfile.all-in-one
push: true
build-args:
Expand All @@ -267,7 +268,7 @@ steps:
- "${IMAGE_REPO}"
extra_tags:
- "${BUILDKITE_TAG}"
- theopenlane/container-build#v1.1.0:
- theopenlane/container-build#v1.0.0:
dockerfile: docker/Dockerfile
push: true
build-args:
Expand All @@ -294,7 +295,7 @@ steps:
- "${GCR_REPO}"
extra_tags:
- "${BUILDKITE_TAG}"
- theopenlane/container-build#v1.1.0:
- theopenlane/container-build#v1.0.0:
dockerfile: docker/all-in-one/Dockerfile.all-in-one
push: true
build-args:
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.6 AS builder
FROM golang:1.23.0 AS builder

WORKDIR /go/src/app
COPY . .
Expand Down
222 changes: 222 additions & 0 deletions internal/ent/generated/edge_cleanup.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/ent/templates/edge_cleanup.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{{/* For each edge */}}
{{- range $edge := $node.Edges }}
{{/* if the edge has our custom annotation applied */}}
{{- if $annotation := $edge.Annotations.ENT_CASCADE }}
{{- if $annotation := $edge.Annotations.OPENLANE_CASCADE }}
{{/* use the client to delete records where the edge schema has a field (provided by the annotation) containing the ID provided by the func */}}
{{/* special case for child fields */}}
{{- if eq $annotation.Field "Child" }}
Expand All @@ -37,7 +37,7 @@
{{ end }}
{{ end }}
{{- end }}
{{- if $annotation := $node.Annotations.ENT_CASCADE_THROUGH }}
{{- if $annotation := $node.Annotations.OPENLANE_CASCADE_THROUGH }}
{{- range $schema := $annotation.Schemas }}
{{- $field := $schema.Through }}
{{/* use the client to delete records where the edge has a field and a through schema (provided by the annotation) containing the ID provided by the func */}}
Expand Down
2 changes: 1 addition & 1 deletion internal/graphapi/apitoken_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func (suite *GraphTestSuite) TestMutationCreateAPIToken() {
assert.NotEqual(t, redacted, resp.CreateAPIToken.APIToken.Token)

// ensure the token is prefixed
assert.Contains(t, resp.CreateAPIToken.APIToken.Token, "dtma_")
assert.Contains(t, resp.CreateAPIToken.APIToken.Token, "tola_")
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/graphapi/personalaccesstoken_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func (suite *GraphTestSuite) TestMutationCreatePersonalAccessToken() {
assert.NotEqual(t, redacted, resp.CreatePersonalAccessToken.PersonalAccessToken.Token)

// ensure the token is prefixed
assert.Contains(t, resp.CreatePersonalAccessToken.PersonalAccessToken.Token, "dtmp_")
assert.Contains(t, resp.CreatePersonalAccessToken.PersonalAccessToken.Token, "tolp_")
})
}
}
Expand Down

0 comments on commit a3ea770

Please sign in to comment.