Skip to content

Commit

Permalink
Add information on development for MacOS contributors. (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 authored Sep 27, 2023
1 parent f685e51 commit 3a8c20e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Dockerfile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM golang:1.21
WORKDIR /work
COPY go.* .
RUN go mod download
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build make test
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ build:
test: build
go test -cover ./...

.PHONY: test-in-docker
test-in-docker:
docker build -f Dockerfile.test --progress plain .

.PHONY: lint-structs
lint-structs:
@golangci-lint run --enable exhaustruct ./cmd --tests=false || \
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ contexts:
```
Optional you can specify `issuer_type: generic` if you use other issuers as Dex, e.g. Keycloak (this will request scopes `openid,profile,email`):

```bash
contexts:
prod:
Expand All @@ -101,6 +102,7 @@ contexts:
```

If you must specify special scopes for your issuer, you can use `custom_scopes`:

```bash
contexts:
prod:
Expand All @@ -118,3 +120,9 @@ Full documentation is generated out of the cobra command implementation with:
`metalctl markdown`

generated markdown is [here](docs/metalctl.md) and [here](https://docs.metal-stack.io/stable/external/metalctl/README/)

## Development

For MacOS users, running the tests might throw an error because tests are utilizing [go-mpatch](https://github.com/undefinedlabs/go-mpatch) in order to manipulate the `time.Now` function. The patch allows testing with fixed timestamps.

Instead, MacOS users can utilize the `make test-in-docker` target to execute the tests.

0 comments on commit 3a8c20e

Please sign in to comment.