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

[test]Add e2e testcases, integrates with CI #206

Merged
merged 6 commits into from Feb 21, 2022
Merged

Conversation

zhu733756
Copy link
Member

zhu733756 zhu733756@kubesphere.io

  • add e2e CI
  • add e2e testcases
  • fix CRD scope
  • fix comments && make the reconciler get all namespaces every time

/cc @benjaminhuo @wanjunlei @wenchajun

Signed-off-by: zhu733756 <zhu733756@kubesphere.io>
Signed-off-by: zhu733756 <zhu733756@kubesphere.io>
Signed-off-by: zhu733756 <zhu733756@kubesphere.io>
Signed-off-by: zhu733756 <zhu733756@kubesphere.io>
@@ -63,7 +63,7 @@ ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
test: manifests generate fmt vet ## Run tests.
mkdir -p ${ENVTEST_ASSETS_DIR}
test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.8.3/hack/setup-envtest.sh
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./... -coverprofile cover.out
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./apis/... -coverprofile cover.out
Copy link
Member Author

Choose a reason for hiding this comment

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

Currently, the function tests are located in this path. Make it not include the e2e paths.

controllers/fluentbitconfig_controller.go Show resolved Hide resolved
controllers/fluentdconfig_controller.go Outdated Show resolved Hide resolved
controllers/fluentdconfig_controller.go Outdated Show resolved Hide resolved
controllers/fluentdconfig_controller.go Outdated Show resolved Hide resolved
controllers/fluentdconfig_controller.go Outdated Show resolved Hide resolved
}

cfg.Spec.WatchedNamespaces = allNamespaces
// Don't patch the CR, or it would requeue.
cfg.Spec.WatchedNamespaces = watchedNamespaces
}
Copy link
Member

Choose a reason for hiding this comment

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

Do we have to put every namespace into WatchedNamespaces?
No easier way to represent all namespace instead of iterating every namespace?

Copy link
Member Author

Choose a reason for hiding this comment

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

The former codes cache it, I wonder if the namespaces changed, would mix some namespaces.

Copy link
Member

Choose a reason for hiding this comment

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

Let's discuss this later, I think there is no need to iterating every ns in case of all namespace

Copy link
Member Author

Choose a reason for hiding this comment

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

OK.

Signed-off-by: zhu733756 <zhu733756@kubesphere.io>
Signed-off-by: zhu733756 <zhu733756@kubesphere.io>
@benjaminhuo benjaminhuo merged commit 0ae22f6 into fluent:master Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants