Skip to content
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

Add information on development for MacOS contributors. #214

Merged
merged 3 commits into from
Sep 27, 2023
Merged
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
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.