Skip to content
Draft
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
14 changes: 14 additions & 0 deletions .buildkite/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ steps:
- "scripts/ci/helm-unittest.sh"
agents: { queue: standard }

# Internal releases point values.yaml at the internal registry and pin new
# image tags and chart versions (see release.yaml). Rerun the unit tests with
# placeholder values rewritten the same way, so a test that asserts the
# defaults fails on its PR instead of on the release branch.
- label: ":test_tube: Unit Tests with internal release values"
command: |
find charts -name values.yaml -exec sed -i -E \
-e 's#^([[:space:]]*repository:) index\.docker\.io/sourcegraph$#\1 us-docker.pkg.dev/sourcegraph-images/internal#' \
-e 's#^([[:space:]]*defaultTag:) [0-9.]+@sha256:[0-9a-f]{64}$#\1 99.0.0@sha256:0000000000000000000000000000000000000000000000000000000000000000#' {} +
find charts -name Chart.yaml -exec sed -i -E 's#^([[:space:]]*(version|appVersion):) "[0-9]+\.[0-9]+\.[0-9]+"$#\1 "99.0.0"#' {} +
git diff --stat
scripts/ci/helm-unittest.sh
agents: { queue: standard }

- label: ":database: Schema Validation"
commands:
- "scripts/ci/validate-schema.sh"
Expand Down
17 changes: 14 additions & 3 deletions charts/sourcegraph/tests/dataDirPermissionsInitContainer_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,47 @@ release:
name: sourcegraph
namespace: sourcegraph
tests:
# Releases rewrite sourcegraph.image.repository in values.yaml, so pin it here
# instead of asserting the chart default.
- it: should run the pgsql init container on the pgsql image
template: pgsql/pgsql.StatefulSet.yaml
set:
sourcegraph:
image:
repository: my.registry.example/sg
pgsql:
image:
name: custom-postgres
defaultTag: test
asserts:
- equal:
path: spec.template.spec.initContainers[?(@.name == "correct-data-dir-permissions")].image
value: index.docker.io/sourcegraph/custom-postgres:test
value: my.registry.example/sg/custom-postgres:test
- it: should run the codeintel-db init container on the codeintel-db image
template: codeintel-db/codeintel-db.StatefulSet.yaml
set:
sourcegraph:
image:
repository: my.registry.example/sg
codeIntelDB:
image:
name: custom-postgres
defaultTag: test
asserts:
- equal:
path: spec.template.spec.initContainers[?(@.name == "correct-data-dir-permissions")].image
value: index.docker.io/sourcegraph/custom-postgres:test
value: my.registry.example/sg/custom-postgres:test
- it: should run the codeinsights-db init container on the codeinsights-db image
template: codeinsights-db/codeinsights-db.StatefulSet.yaml
set:
sourcegraph:
image:
repository: my.registry.example/sg
codeInsightsDB:
image:
name: custom-postgres
defaultTag: test
asserts:
- equal:
path: spec.template.spec.initContainers[?(@.name == "correct-data-dir-permissions")].image
value: index.docker.io/sourcegraph/custom-postgres:test
value: my.registry.example/sg/custom-postgres:test
Loading