This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Commit 72e1838
authored
fix(appliance): bypass
<!-- PR description tips:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e
-->
Bypass the requirement for
`sigs.k8s.io/controller-runtime/tools/setup-envtest` when running `go
test` in the `internal/appliance` package.
Previously running `go test` without
`sigs.k8s.io/controller-runtime/tools/setup-envtest` installed would
fail the tests that required it. This changes this behavior to instead
skip the tests requiring `setup-envtest` if the user doesn't have it
installed locally.
## Test plan
Tested locally without `setup-envtest` installed:
```shell
go test ./internal/appliance/reconciler... -v
=== RUN TestApplianceTestSuite
helpers_test.go:37: setup-envtest is not installed, skipping ApplianceTestSuite
--- SKIP: TestApplianceTestSuite (0.00s)
PASS
ok github.com/sourcegraph/sourcegraph/internal/appliance/reconciler 0.907s
```
Tested locally with `setup-envtest` installed:
```shell
go test ./internal/appliance/reconciler... -v
...
--- PASS: TestApplianceTestSuite/TestDeployWorker/worker/with-blobstore (0.25s)
--- PASS: TestApplianceTestSuite/TestDeployWorker/worker/with-replicas (0.24s)
--- PASS: TestApplianceTestSuite/TestDoesNotDeleteUnownedResources (0.22s)
--- PASS: TestApplianceTestSuite/TestFrontendDeploymentRollsWhenPGSecretsChange (1.36s)
--- PASS: TestApplianceTestSuite/TestFrontendDeploymentRollsWhenPGSecretsChange/pgsql-auth (0.47s)
--- PASS: TestApplianceTestSuite/TestFrontendDeploymentRollsWhenPGSecretsChange/codeinsights-db-auth (0.44s)
--- PASS: TestApplianceTestSuite/TestFrontendDeploymentRollsWhenPGSecretsChange/codeintel-db-auth (0.45s)
--- PASS: TestApplianceTestSuite/TestFrontendDeploymentRollsWhenRedisSecretsChange (0.93s)
--- PASS: TestApplianceTestSuite/TestFrontendDeploymentRollsWhenRedisSecretsChange/redis-cache (0.45s)
--- PASS: TestApplianceTestSuite/TestFrontendDeploymentRollsWhenRedisSecretsChange/redis-store (0.48s)
--- PASS: TestApplianceTestSuite/TestMergeK8sObjects (0.00s)
--- PASS: TestApplianceTestSuite/TestMergeK8sObjects/Successful_merge (0.00s)
--- PASS: TestApplianceTestSuite/TestMergeK8sObjects/Merge_with_overlapping_keys (0.00s)
--- PASS: TestApplianceTestSuite/TestMergeK8sObjects/Merge_with_empty_new_object (0.00s)
--- PASS: TestApplianceTestSuite/TestMergeK8sObjects/merges_annotations (0.00s)
--- PASS: TestApplianceTestSuite/TestNonNamespacedResourcesRemainWhenDisabled (0.45s)
--- PASS: TestApplianceTestSuite/TestResourcesDeletedWhenDisabled (0.45s)
--- PASS: TestApplianceTestSuite/TestStandardFeatures (2.43s)
--- PASS: TestApplianceTestSuite/TestStandardFeatures/standard/blobstore-with-named-storage-class (0.24s)
--- PASS: TestApplianceTestSuite/TestStandardFeatures/standard/frontend-with-no-cpu-memory-resources (0.25s)
--- PASS: TestApplianceTestSuite/TestStandardFeatures/standard/precise-code-intel-with-env-vars (0.24s)
--- PASS: TestApplianceTestSuite/TestStandardFeatures/standard/redis-with-multiple-custom-images (0.25s)
--- PASS: TestApplianceTestSuite/TestStandardFeatures/standard/redis-with-storage (0.25s)
--- PASS: TestApplianceTestSuite/TestStandardFeatures/standard/repo-updater-with-no-resources (0.26s)
--- PASS: TestApplianceTestSuite/TestStandardFeatures/standard/repo-updater-with-pod-template-config (0.23s)
--- PASS: TestApplianceTestSuite/TestStandardFeatures/standard/repo-updater-with-resources (0.25s)
--- PASS: TestApplianceTestSuite/TestStandardFeatures/standard/repo-updater-with-sa-annotations (0.24s)
--- PASS: TestApplianceTestSuite/TestStandardFeatures/standard/symbols-with-custom-image (0.23s)
PASS
ok github.com/sourcegraph/sourcegraph/internal/appliance/reconciler 20.576s
```
<!-- REQUIRED; info at
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->
## Changelog
N/A as this is not a user facing change.
<!-- OPTIONAL; info at
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c
-->setupenv-test for local testing if not installed (#64305)1 parent 991355b commit 72e1838
File tree
7 files changed
+36
-5
lines changed- internal/appliance
- healthchecker
- k8senvtest
- reconciler
- selfupdate
- integrationtest
7 files changed
+36
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
0 commit comments