Skip to content
This repository has been archived by the owner on Oct 3, 2019. It is now read-only.

Makefile setup, test stubs #3

Merged
merged 4 commits into from
Feb 28, 2019

Conversation

michaelkleinhenz
Copy link
Collaborator

This adds a Makefile setup and stubs for unit and e2e tests. Execute make to get a list of possible targets. This was essentially taken from toolchain-operator with added test setup.

Copy link
Contributor

@kwk kwk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I bet 90% of the copy'n'pasted Makefile stuff is not used and therefore shouldn't be added. I would rather start fresh. Especially the test.mk file is way to heavy and shouldn't be copied 1:1.

@@ -0,0 +1,37 @@
FROM centos:7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having two Dockerfiles, we should start using multi-staged Dockerfiles.

Makefile Outdated Show resolved Hide resolved
cmd/manager/main.go Show resolved Hide resolved
@michaelkleinhenz
Copy link
Collaborator Author

@kwk no, all of the code is used/tested/inspected with the exception of the coverage and the windows stuff. There is not much overhead and I have gone over the make process line-by-line. @dipak-pawar did a great job there.

Gopkg.lock Outdated
revision = "de5bf2ad457846296e2031421a34e2568e304e35"

[[projects]]
digest = "1:4b8b5811da6970495e04d1f4e98bb89518cc3cfc3b3f456bdb876ed7b6c74049"
branch = "master"
name = "github.com/alexeykazakov/devconsole"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to rename all github.com/alexeykazakov/devconsole packages :) In a separate PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, rebased. There are also some base image references in the dockerfiles that need updating once we know the repository address.

@sbose78
Copy link
Member

sbose78 commented Feb 14, 2019

Opened a PR to make the code build #4

@kwk
Copy link
Contributor

kwk commented Feb 15, 2019

@kwk no, all of the code is used/tested/inspected with the exception of the coverage and the windows stuff. There is not much overhead and I have gone over the make process line-by-line. @dipak-pawar did a great job there.

That is my point, the coverage stuff takes up 90% of the code and can be simplified/removed like crazy.

@michaelkleinhenz
Copy link
Collaborator Author

@kwk Coverage is now also tested and working. Removed/updated a few things, also removed windows support. 98d2b3f.

deploy/test/global-manifests.yaml Outdated Show resolved Hide resolved
deploy/test/global-manifests.yaml Outdated Show resolved Hide resolved
deploy/test/global-manifests.yaml Outdated Show resolved Hide resolved
LABEL maintainer "Devtools <devtools@redhat.com>"
LABEL author "Devtools <devtools@redhat.com>"
ENV LANG=en_US.utf8
ENV F8_INSTALL_PREFIX=/usr/local/devconsole-operator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe let's get rid out of F8 prefix

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed befe3ef.

ENV F8_INSTALL_PREFIX=/usr/local/devconsole-operator

# Create a non-root user and a group with the same name: "devconsole-operator"
ENV F8_USER_NAME=devconsole-operator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe let's get rid out of F8 prefix

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed befe3ef.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michaelkleinhenz no it wasn't fixed in befe3ef. The code is still in there. We have F8_ in various other locations and files as well if you take a look at the PR now. I suggest to keep the F8_ and not replace it now. The reason is that environment variables marked with F8_ are those that you should care about setting from the outside when running a Makefile for example: F8_POSTGRES_HOST=foo make test-integration. Can you revert the parts of befe3ef that modify the F8_ bits please and keep the rest until we have a proper replacement for F8_?

Makefile Outdated Show resolved Hide resolved
REGISTRY_IMAGE = ${PROJECT_NAME}

ifeq ($(TARGET),rhel)
REGISTRY_URL := ${REGISTRY_URI}/openshiftio/rhel-${REGISTRY_NS}-${REGISTRY_IMAGE}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we change docker org as we are starting fresh?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as below. Let's do this when we know how it will look like.

@@ -0,0 +1,89 @@
DOCKER_REPO?=quay.io/openshiftio
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we change this docker org?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let's do this when we know what it is..

make/Makefile.dev Outdated Show resolved Hide resolved
make/test.mk Outdated
.PHONY: e2e-cleanup
e2e-cleanup:
oc login -u system:admin
oc delete oauthclient codeready-devconsole || true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be removed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed befe3ef.

make/test.mk Outdated Show resolved Hide resolved
make/test.mk Outdated Show resolved Hide resolved
test/README.md Outdated Show resolved Hide resolved
Copy link
Member

@alexeykazakov alexeykazakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move on with that change :) We can improve it later. But it's IMO a good start and worth merging now so we can simplify local development a lot.

kwk
kwk previously requested changes Feb 22, 2019
Copy link
Contributor

@kwk kwk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michaelkleinhenz I went through all commits and resolved all conversations that you addressed. That leaves a few open on which I would like to ask that you comment on them. @alexeykazakov Yes we can improve later but let's fix this tiny F8_ bit first, okay? Shouldn't cost much time.

ENV F8_INSTALL_PREFIX=/usr/local/devconsole-operator

# Create a non-root user and a group with the same name: "devconsole-operator"
ENV F8_USER_NAME=devconsole-operator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michaelkleinhenz no it wasn't fixed in befe3ef. The code is still in there. We have F8_ in various other locations and files as well if you take a look at the PR now. I suggest to keep the F8_ and not replace it now. The reason is that environment variables marked with F8_ are those that you should care about setting from the outside when running a Makefile for example: F8_POSTGRES_HOST=foo make test-integration. Can you revert the parts of befe3ef that modify the F8_ bits please and keep the rest until we have a proper replacement for F8_?

@alexeykazakov
Copy link
Member

@michaelkleinhenz any updates on that PR?

Copy link
Contributor

@corinnekrych corinnekrych left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreedwith alexey, let's merge this initial version we can improve afterwards.

@sbose78 sbose78 dismissed kwk’s stale review February 28, 2019 16:42

Not dismissing, let's address it in another PR.

@sbose78 sbose78 merged commit f130073 into redhat-developer:master Feb 28, 2019
corinnekrych pushed a commit to corinnekrych/devopsconsole-operator that referenced this pull request Mar 4, 2019
* Added stub tests and makefile setup.
* Exposed more targets, removed windows make code, checked coverage, minor fixes.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants