Skip to content

Commit

Permalink
Merge pull request #477 from sapcc/conformance
Browse files Browse the repository at this point in the history
Fix starting conformance-test
  • Loading branch information
majewsky authored Jan 8, 2025
2 parents 3edc739 + d066723 commit 98624f2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ testing/conformance-test/privkey.pem:
# (see env.sh mentioned below) will be pre-configured and ready to use for the test run.
run-api-for-conformance-test: build/keppel testing/conformance-test/privkey.pem
@echo "Ready to run conformance test"
set -euo pipefail && source testing/conformance-test/env.sh && $(CURDIR)/build/keppel server api
set -euo pipefail && source testing/conformance-test/env.sh && testing/conformance-test/with-postgres-db.sh $(CURDIR)/build/keppel server api

install-golangci-lint: FORCE
@if ! hash golangci-lint 2>/dev/null; then printf "\e[1;36m>> Installing golangci-lint (this may take a while)...\e[0m\n"; go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest; fi
Expand Down
2 changes: 1 addition & 1 deletion Makefile.maker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ verbatim: |
# (see env.sh mentioned below) will be pre-configured and ready to use for the test run.
run-api-for-conformance-test: build/keppel testing/conformance-test/privkey.pem
@echo "Ready to run conformance test"
set -euo pipefail && source testing/conformance-test/env.sh && $(CURDIR)/build/keppel server api
set -euo pipefail && source testing/conformance-test/env.sh && testing/conformance-test/with-postgres-db.sh $(CURDIR)/build/keppel server api
4 changes: 2 additions & 2 deletions cmd/api/peering.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import (
"database/sql"
"encoding/json"
"errors"
"os"
"strings"
"time"

"github.com/sapcc/go-bits/logg"
"github.com/sapcc/go-bits/must"
"github.com/sapcc/go-bits/osext"
"github.com/sapcc/go-bits/sqlext"

"github.com/sapcc/keppel/internal/keppel"
Expand All @@ -50,7 +50,7 @@ func runPeering(ctx context.Context, cfg keppel.Configuration, db *keppel.DB) {
isPeerHostName := make(map[string]bool)

var peeringCfg peeringConfig
decoder := json.NewDecoder(strings.NewReader(os.Getenv("KEPPEL_PEERS")))
decoder := json.NewDecoder(strings.NewReader(osext.GetenvOrDefault("KEPPEL_PEERS", "[]")))
decoder.DisallowUnknownFields()
must.Succeed(decoder.Decode(&peeringCfg))

Expand Down
4 changes: 2 additions & 2 deletions testing/conformance-test/env.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export KEPPEL_API_PUBLIC_FQDN=localhost
export KEPPEL_ISSUER_KEY=./testing/conformance-test/privkey.pem
export KEPPEL_ISSUER_KEY=./conformance-test/privkey.pem
export KEPPEL_DB_CONNECTION_OPTIONS=sslmode=disable
export KEPPEL_DB_PASSWORD=mysecretpassword
export KEPPEL_DB_PORT=54321
Expand All @@ -10,7 +10,7 @@ export KEPPEL_DRIVER_AUTH=trivial
export KEPPEL_DRIVER_FEDERATION=trivial
export KEPPEL_DRIVER_INBOUND_CACHE=trivial
export KEPPEL_DRIVER_STORAGE=filesystem
export KEPPEL_FILESYSTEM_PATH=./testing/conformance-test/storage
export KEPPEL_FILESYSTEM_PATH=./conformance-test/storage

# clean out the backing storage from the previous run (the `test -d` is a
# safety net to ensure that we don't delete something unintended by accident)
Expand Down

0 comments on commit 98624f2

Please sign in to comment.