Skip to content
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
23 changes: 8 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -362,18 +362,11 @@ git-unsanitize:
release-local-operator:
IMAGE_REPO=$(IMAGE_REPO) hack/release-local.sh

.PHONY: release-local-bundle
release-local-bundle:
IMAGE_REPO=$(IMAGE_REPO) \
BUNDLE_REPO=$(BUNDLE_REPO) hack/release-local.sh

.PHONY: release-local-catalog
release-local-catalog: opm
IMAGE_REPO=$(IMAGE_REPO) \
BUNDLE_REPO=$(BUNDLE_REPO) \
CATALOG_REPO=$(CATALOG_REPO) \
OPM=$(OPM) hack/release-local.sh

.PHONY: local-e2e
local-e2e:
hack/local-e2e.sh
.PHONY: deploy-local
deploy-local:
hack/deploy-local.sh

.PHONY: e2e
e2e: ginkgo
cd test/e2e && $(GINKGO) build
cd test/e2e && ./e2e.test --lvm-operator-install=false --lvm-operator-uninstall=false -ginkgo.v
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,26 +321,30 @@ To perform a full cleanup, follow these steps:

## E2E Tests

There are a few steps require to run the end-to-end tests for LVMS.
There are a few steps required to run the end-to-end tests for LVMS.

You will need the following evironment variables set:
```bash
IMAGE_REGISTRY={{REGISTRY_URL}} # Ex: quay.io
REGISTRY_NAMESPACE={{REGISTRY_NAMESPACE}} # Ex: lvms-dev
REGISTRY_NAMESPACE={{REGISTRY_NAMESPACE}} # Ex: lvms-dev, this should be your own personal namespace
```

Once the environment variables are set, you can run
```bash
$ make local-e2e
```
# build and deploy your local code to the cluster
$ make deploy-local

# Wait for the lvms-operator to have status=Running
$ oc -n openshift-storage get pods
# NAME READY STATUS RESTARTS AGE
# lvms-operator-579fbf46d5-vjwhp 3/3 Running 0 3m27s

That command will:
- Do any repo sanitization needed (in case changes are made)
- Build the Operator and tag it with the git hash
- Build the Operator Bundle and tag it with the git hash
- Build the Operator Catalog adn tag it with the git hash
- Run the e2e tests against the built images
- Undo any sanitization that was needed for the repo
# run the e2e tests
$ make e2e

# undeploy the operator from the cluster
$ make undeploy
```

## Metrics

Expand Down
15 changes: 15 additions & 0 deletions hack/deploy-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -euo pipefail

make git-sanitize

# Build and push the operator
make release-local-operator

# Run the tests
GITREV=$(git rev-parse HEAD)

export IMAGE_TAG="${GITREV}"
make deploy

make git-unsanitize
17 changes: 0 additions & 17 deletions hack/local-e2e.sh

This file was deleted.

2 changes: 1 addition & 1 deletion hack/release-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ fi

# If BUNDLE_REPO is defined, build the bundle
BUNDLE_REPO="${BUNDLE_REPO:-}"
CATALOG_REPO="${CATALOG_REPO:-}"
if [ -n "$BUNDLE_REPO" ]; then
BUNDLE_IMG=${BUNDLE_REPO}:${GITREV}
${BUILDER} build -f bundle.Dockerfile -t ${BUNDLE_IMG} .
${BUILDER} push ${BUNDLE_REPO}:${GITREV}

# If CATALOG_REPO is defined, build the catalog
CATALOG_REPO="${CATALOG_REPO:-}"
if [ -n "$CATALOG_REPO" ]; then
OPM="${OPM:-}"
if [ -z "$OPM" ]; then echo "ERROR: OPM is a required variable"; exit 1; fi
Expand Down