-
Notifications
You must be signed in to change notification settings - Fork 4
Update tests for clarity and dependencies to latest versions #2314
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
Conversation
69eeb53
to
ea92271
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates several test assertions for improved clarity and consistency, and upgrades Go module dependencies to the latest versions. Key changes include replacing direct assertions (using assert.Equal with an empty string) with more expressive assert.Empty calls, and refactoring several method calls to use updated naming conventions for paths and relations.
Reviewed Changes
Copilot reviewed 121 out of 123 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
internal/pkg/mapper/variables/local_persist_test.go | Updated assertions to verify unified handling of relations |
internal/pkg/mapper/variables/local_persist.go | Changed relation addition method from ConfigRowManifest to a direct method call on row |
internal/pkg/mapper/transformation/local_save.go | Updated naming method call from ObjectManifest.Path() to w.Path() for determining blocksDir |
internal/pkg/mapper/transformation/local_load.go | Refactored method calls to use updated path retrieval methods |
internal/pkg/mapper/template/replacevalues/replace_test.go | Replaced assert.Equal with assert.Empty for clearer intent in testing |
internal/pkg/mapper/sharedcode/* | Updated path retrieval calls for shared code file handling |
internal/pkg/mapper/orchestrator/local_save.go | Switched to new path retrieval functions for configPath and phasesDir |
internal/pkg/mapper/corefiles/local_load_test.go | Updated manifest records handling function call |
internal/pkg/git/remote.go | Fixed reference to base path in file removal |
internal/pkg/fixtures/fixtures.go | Corrected default branch field reference |
internal/pkg/filesystem/* | Minor lint comment updates and improved test assertions for empty values |
internal/pkg/env/map_test.go, internal/pkg/encoding/jsonnet/placeholder_test.go, internal/pkg/encoding/json/schema/meta_test.go | Updated assertions to assert.Empty for clarity |
internal/pkg/diff/diff_test.go | Updated state retrieval calls for remote and local states consistently |
.github/actions/go-setup/action.yml | Added a step to install golangci-lint v2.0.2 |
Files not reviewed (2)
- Makefile: Language not supported
- go.mod: Language not supported
Comments suppressed due to low confidence (2)
internal/pkg/mapper/variables/local_persist.go:144
- Ensure that replacing 'row.ConfigRowManifest.AddRelation' with 'row.AddRelation' maintains the intended behavior for handling relations, as this change could affect test outcomes.
row.AddRelation(&model.VariablesValuesForRelation{})
internal/pkg/mapper/transformation/local_save.go:44
- Verify that using 'w.Path()' instead of 'w.ObjectManifest.Path()' returns the correct directory for blocks, ensuring consistency with other path-retrieval methods across the codebase.
blocksDir := w.NamingGenerator().BlocksDir(w.Path())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…est cases for improved clarity
…ttings and restructuring rules
ea92271
to
255168f
Compare
255168f
to
ba10077
Compare
Templates API Kubernetes Diff [CI]Between Expand--- /tmp/artifacts/test-k8s-state.old.json.processed.kv 2025-04-02 15:04:49.886662139 +0000
+++ /tmp/artifacts/test-k8s-state.new.json.processed.kv 2025-04-02 15:04:50.052663764 +0000
@@ -197 +197 @@
-<Deployment/templates-api>.spec.template.spec.containers[0].image = "docker.io/keboola/templates-api:f6520d9-1743605810";
+<Deployment/templates-api>.spec.template.spec.containers[0].image = "docker.io/keboola/templates-api:6a31dd3-1743606034";
@@ -759,3 +759,3 @@
-<Pod/templates-api-<hash>>.spec.containers[0].image = "docker.io/keboola/templates-api:f6520d9-1743605810";
-<Pod/templates-api-<hash>>.spec.containers[0].image = "docker.io/keboola/templates-api:f6520d9-1743605810";
-<Pod/templates-api-<hash>>.spec.containers[0].image = "docker.io/keboola/templates-api:f6520d9-1743605810";
+<Pod/templates-api-<hash>>.spec.containers[0].image = "docker.io/keboola/templates-api:6a31dd3-1743606034";
+<Pod/templates-api-<hash>>.spec.containers[0].image = "docker.io/keboola/templates-api:6a31dd3-1743606034";
+<Pod/templates-api-<hash>>.spec.containers[0].image = "docker.io/keboola/templates-api:6a31dd3-1743606034";
@@ -1432 +1432 @@
-<ReplicaSet/templates-api-<hash>>.spec.template.spec.containers[0].image = "docker.io/keboola/templates-api:f6520d9-1743605810";
+<ReplicaSet/templates-api-<hash>>.spec.template.spec.containers[0].image = "docker.io/keboola/templates-api:6a31dd3-1743606034";
@@ -1503,0 +1504,12 @@
+<Secret/sh.helm.release.v1.templates-api-etcd.v2> = {};
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.apiVersion = "v1";
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.data = {};
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.kind = "Secret";
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.metadata = {};
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.metadata.labels = {};
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.metadata.labels.name = "templates-api-etcd";
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.metadata.labels.owner = "helm";
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.metadata.labels.version = "2";
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.metadata.name = "sh.helm.release.v1.templates-api-etcd.v2";
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.metadata.namespace = "templates-api";
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.type = "helm.sh/release.v1";
(see artifacts in the Github Action for more information) |
Jira: PSGO-1053
Changes:
assert.Equal
withassert.Empty
in multiple test cases for improved clarity.https://golangci-lint.run/