Skip to content

Makefile: Use hyphen instead of slash #2019

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

Merged
merged 10 commits into from
Oct 22, 2019
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
34 changes: 17 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
- if: tag IS present OR branch != master
<<: *test
name: Go on Kubernetes
script: make test/e2e/go
script: make test-e2e-go

# Build and test ansible and test ansible using molecule in non-master PRs
- if: tag IS present OR branch != master
Expand All @@ -119,75 +119,75 @@ jobs:
- pip3 install --upgrade setuptools pip
- pip install --user ansible
script:
- make test/e2e/ansible
- make test/e2e/ansible-molecule
- make test-e2e-ansible
- make test-e2e-ansible-molecule

# Build and test helm in non-master PRs
- if: tag IS present OR branch != master
<<: *test
name: Helm on Kubernetes
script: make test/e2e/helm
script: make test-e2e-helm

# Test subcommands in non-master PRs
- if: tag IS present OR branch != master
<<: *test
name: Subcommands on Kubernetes
script: make test/subcommand
script: make test-subcommand

# Test olm install/uninstall subcommands on master, as these cannot be tested in prow/api-ci.
- if: tag IS NOT present AND branch = master
<<: *test
name: OLM Install/Uninstall on Kubernetes
script: make test/subcommand/olm-install
script: make test-subcommand-olm-install

# Build and test ansible using molecule, as this cannot be tested in prow/api-ci.
- if: tag IS NOT present AND branch = master
<<: *test
name: Ansible Molecule on Kubernetes
script: make test/e2e/ansible-molecule
script: make test-e2e-ansible-molecule

# Run the unit, sanity, and markdown tests
- stage: test
name: Unit, Sanity, and Markdown Tests
# Currently, prow/api-ci tests all PRs that target master; use travis for post merge testing and non-master PRs
if: type != pull_request OR branch != master
<<: *dep_before_install
script: make test/sanity test/unit test/markdown
script: make test-sanity test-unit test-markdown
after_success: echo 'Tests Passed'
after_failure: echo 'Failure in unit, sanity, or markdown test'

# Build and deploy ansible-operator docker image
- <<: *deploy
name: Docker image for ansible-operator
script:
- make image/build/ansible
- make image/push/ansible
- make image-build-ansible
- make image-push-ansible

# Build and deploy amd64 helm-operator docker image
- <<: *deploy
name: Docker image for helm-operator (amd64)
os: linux
script:
- make image/build/helm
- make image/push/helm
- make image-build-helm
- make image-push-helm

# Build and deploy ppc64le helm-operator docker image
- <<: *deploy
name: Docker image for helm-operator (ppc64le)
os: linux-ppc64le
script:
- make image/build/helm
- make image/push/helm
- make image-build-helm
- make image-push-helm

# Build and deploy scorecard-proxy docker image
- <<: *deploy
name: Docker image for scorecard-proxy
script:
- make image/build/scorecard-proxy
- make image/push/scorecard-proxy
- make image-build-scorecard-proxy
- make image-push-scorecard-proxy

# Build and deploy helm multi-arch manifest list
- <<: *manifest-deploy
name: Manifest list for helm-operator
script:
- make image/push/helm-multiarch
- make image-push-helm-multiarch
62 changes: 31 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,89 +104,89 @@ build/%.asc:
}

# Static tests.
.PHONY: test test/markdown test/sanity test/unit
.PHONY: test test-markdown test-sanity test-unit

test: test/unit ## Run the tests
test: test-unit ## Run the tests

test/markdown:
test-markdown test/markdown:
./hack/ci/marker --root=doc

test/sanity: tidy
test-sanity test/sanity: tidy
./hack/tests/sanity-check.sh

test/unit: ## Run the unit tests
test-unit test/unit: ## Run the unit tests
$(Q)go test -count=1 -short ./cmd/...
$(Q)go test -count=1 -short ./pkg/...
$(Q)go test -count=1 -short ./internal/...

# CI tests.
.PHONY: test/ci
.PHONY: test-ci

test/ci: test/markdown test/sanity test/unit install test/subcommand test/e2e ## Run the CI test suite
test-ci: test-markdown test-sanity test-unit install test-subcommand test-e2e ## Run the CI test suite

# Subcommand tests.
.PHONY: test/subcommand test/subcommand/test-local test/subcommand/scorecard test/subcommand/olm-install
.PHONY: test-subcommand test-subcommand-local test-subcommand-scorecard test-subcommand-olm-install

test/subcommand: test/subcommand/test-local test/subcommand/scorecard test/subcommand/olm-install
test-subcommand: test-subcommand-local test-subcommand-scorecard test-subcommand-olm-install

test/subcommand/test-local:
test-subcommand-local:
./hack/tests/subcommand.sh

test/subcommand/scorecard:
test-subcommand-scorecard:
./hack/tests/subcommand-scorecard.sh

test/subcommand/olm-install:
test-subcommand-olm-install:
./hack/tests/subcommand-olm-install.sh

# E2E tests.
.PHONY: test/e2e test/e2e/go test/e2e/ansible test/e2e/ansible-molecule test/e2e/helm
.PHONY: test-e2e test-e2e-go test-e2e-ansible test-e2e-ansible-molecule test-e2e-helm

test/e2e: test/e2e/go test/e2e/ansible test/e2e/ansible-molecule test/e2e/helm ## Run the e2e tests
test-e2e: test-e2e-go test-e2e-ansible test-e2e-ansible-molecule test-e2e-helm ## Run the e2e tests

test/e2e/go:
test-e2e-go:
./hack/tests/e2e-go.sh $(ARGS)

test/e2e/ansible: image/build/ansible
test-e2e-ansible: image-build-ansible
./hack/tests/e2e-ansible.sh

test/e2e/ansible-molecule: image/build/ansible
test-e2e-ansible-molecule: image-build-ansible
./hack/tests/e2e-ansible-molecule.sh

test/e2e/helm: image/build/helm
test-e2e-helm: image-build-helm
./hack/tests/e2e-helm.sh

# Image scaffold/build/push.
.PHONY: image image/scaffold/ansible image/scaffold/helm image/build image/build/ansible image/build/helm image/push image/push/ansible image/push/helm
.PHONY: image image-scaffold-ansible image-scaffold-helm image-build image-build-ansible image-build-helm image-push image-push-ansible image-push-helm

image: image/build image/push ## Build and push all images
image: image-build image-push ## Build and push all images

image/scaffold/ansible:
image-scaffold-ansible:
go run ./hack/image/ansible/scaffold-ansible-image.go

image/scaffold/helm:
image-scaffold-helm:
go run ./hack/image/helm/scaffold-helm-image.go

image/build: image/build/ansible image/build/helm image/build/scorecard-proxy ## Build all images
image-build: image-build-ansible image-build-helm image-build-scorecard-proxy ## Build all images

image/build/ansible: build/operator-sdk-dev-x86_64-linux-gnu
image-build-ansible: build/operator-sdk-dev-x86_64-linux-gnu
./hack/image/build-ansible-image.sh $(ANSIBLE_BASE_IMAGE):dev

image/build/helm: build/operator-sdk-dev
image-build-helm: build/operator-sdk-dev
./hack/image/build-helm-image.sh $(HELM_BASE_IMAGE):dev

image/build/scorecard-proxy:
image-build-scorecard-proxy:
./hack/image/build-scorecard-proxy-image.sh $(SCORECARD_PROXY_BASE_IMAGE):dev

image/push: image/push/ansible image/push/helm image/push/scorecard-proxy ## Push all images
image-push: image-push-ansible image-push-helm image-push-scorecard-proxy ## Push all images

image/push/ansible:
image-push-ansible:
./hack/image/push-image-tags.sh $(ANSIBLE_BASE_IMAGE):dev $(ANSIBLE_IMAGE)

image/push/helm:
image-push-helm:
./hack/image/push-image-tags.sh $(HELM_BASE_IMAGE):dev $(HELM_IMAGE)-$(shell go env GOARCH)

image/push/helm-multiarch:
image-push-helm-multiarch:
./hack/image/push-manifest-list.sh $(HELM_IMAGE) ${HELM_ARCHES}

image/push/scorecard-proxy:
image-push-scorecard-proxy:
./hack/image/push-image-tags.sh $(SCORECARD_PROXY_BASE_IMAGE):dev $(SCORECARD_PROXY_IMAGE)
2 changes: 1 addition & 1 deletion ci/dockerfiles/ansible-e2e-hybrid.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM osdk-builder as builder

RUN make image/scaffold/ansible
RUN make image-scaffold-ansible
RUN ci/tests/scaffolding/e2e-ansible-scaffold-hybrid.sh

FROM registry.access.redhat.com/ubi8/ubi
Expand Down
2 changes: 1 addition & 1 deletion ci/dockerfiles/ansible.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM osdk-builder as builder

RUN make image/scaffold/ansible
RUN make image-scaffold-ansible

FROM registry.access.redhat.com/ubi8/ubi

Expand Down
2 changes: 1 addition & 1 deletion ci/dockerfiles/helm-e2e-hybrid.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM osdk-builder as builder

RUN make image/scaffold/helm
RUN make image-scaffold-helm
RUN ci/tests/scaffolding/e2e-helm-scaffold-hybrid.sh

FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
Expand Down
2 changes: 1 addition & 1 deletion ci/dockerfiles/helm.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM osdk-builder as builder

RUN make image/scaffold/helm
RUN make image-scaffold-helm

FROM registry.access.redhat.com/ubi8/ubi-minimal:latest

Expand Down
8 changes: 4 additions & 4 deletions ci/prow.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ export GOPROXY ?= https://proxy.golang.org/
build:
$(MAKE) -f Makefile build/operator-sdk

test/e2e/go:
test-e2e-go test/e2e/go:
./ci/tests/e2e-go.sh $(ARGS)

test/e2e/ansible:
test-e2e-ansible test/e2e/ansible:
./ci/tests/e2e-ansible.sh

test/e2e/helm:
test-e2e-helm test/e2e/helm:
./ci/tests/e2e-helm.sh

test/subcommand:
test-subcommand test/subcommand:
./ci/tests/subcommand.sh
2 changes: 1 addition & 1 deletion doc/dev/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To build the binary and run all tests (assuming you have a correctly configured
you can simple run:

```sh
$ make test/ci
$ make test-ci
```

If you simply want to run the unit tests, you can run:
Expand Down
26 changes: 13 additions & 13 deletions doc/dev/testing/running-the-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ $ export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"

All the tests are run through the [`Makefile`][makefile]. This is a brief description of all makefile test instructions:

- `test` - Runs the unit tests (`test/unit`).
- `test/ci` - Runs markdown, sanity, and unit tests, installs the SDK binary, and runs the SDK subcommand and all E2E tests.
- `test/sanity` - Runs sanity checks.
- `test/unit` - Runs unit tests.
- `test/subcommand` - Runs subcommand tests.
- `test/e2e` - Runs all E2E tests (`test/e2e/go`, `test/e2e/ansible`, `test/e2e/ansible-molecule`, and `e2e/helm`).
- `test/e2e/go` - Runs the go E2E test.
- `test/e2e/ansible` - Runs the ansible E2E test.
- `test/e2e/ansible-molecule` - Runs the ansible molecule E2E test.
- `test/e2e/helm` - Runs the helm E2E test.
- `test/markdown` - Runs the markdown checks
- `test` - Runs the unit tests (`test-unit`).
- `test-ci` - Runs markdown, sanity, and unit tests, installs the SDK binary, and runs the SDK subcommand and all E2E tests.
- `test-sanity` - Runs sanity checks.
- `test-unit` - Runs unit tests.
- `test-subcommand` - Runs subcommand tests.
- `test-e2e` - Runs all E2E tests (`test-e2e-go`, `test-e2e-ansible`, `test-e2e-ansible-molecule`, and `test-e2e-helm`).
- `test-e2e-go` - Runs the go E2E test.
- `test-e2e-ansible` - Runs the ansible E2E test.
- `test-e2e-ansible-molecule` - Runs the ansible molecule E2E test.
- `test-e2e-helm` - Runs the helm E2E test.
- `test-markdown` - Runs the markdown checks

For more info on what these tests actually do, please see the [Travis Build][travis] doc.

Expand All @@ -72,14 +72,14 @@ and the operator images will be built and stored in you local docker registry.

### Go E2E test flags

The `make test/e2e/go` command accepts an `ARGS` variable containing flags that will be passed to `go test`:
The `make test-e2e-go` command accepts an `ARGS` variable containing flags that will be passed to `go test`:

- `-image-name` string - Sets the operator test image tag to be built and used in testing. Defaults to "quay.io/example/memcached-operator:v0.0.1"
- `-local-repo` string - Sets the path to the local SDK repo being tested. Defaults to the path of the SDK repo containing e2e tests. This is useful for testing customized e2e code.

An example of using `ARGS` is in the note below.

**NOTE**: Some of these tests, specifically the ansible (`test/e2e/ansible`), helm (`test/e2e/helm`), and Go (`test/e2e/go`) tests,
**NOTE**: Some of these tests, specifically the ansible (`test-e2e-ansible`), helm (`test-e2e-helm`), and Go (`test-e2e-go`) tests,
only work when the cluster shares the local docker registry, as is the case with `oc cluster up` and `minikube` after running `eval $(minikube docker-env)`.

```sh
Expand Down
2 changes: 1 addition & 1 deletion doc/dev/testing/travis-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ The Go, Ansible, and Helm tests then differ in what tests they run.

### Ansible tests

1. Run [ansible molecule tests][ansible-molecule]. (`make test/e2e/ansible-molecule)
1. Run [ansible molecule tests][ansible-molecule]. (`make test-e2e-ansible-molecule)
1. Create and configure a new ansible type memcached-operator.
2. Create cluster resources.
3. Run `operator-sdk test local` to run ansible molecule tests
Expand Down