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

added cli bootstrap journey acceptance test #3527

Merged
merged 5 commits into from
Oct 24, 2023
Merged

added cli bootstrap journey acceptance test #3527

merged 5 commits into from
Oct 24, 2023

Conversation

enekofb
Copy link
Contributor

@enekofb enekofb commented Oct 20, 2023

Closes #3508

What changed?

  • Added acceptance test for the bootstrapping workflow using a kind cluster
  • Removed scenario variations as they belong to lower testing layers so does not risk the stability of this layer
  • We explored having it as envtest but given it limitations of having only etcd and kube, and our requirements of needing to reconcile workloads, we discarded the idea.
  • added documentation for testing and ways to run them.

Why was this change made?

  • ensure we have upper layer testing for bootstrapping so we could have regression point for future iterations

How was this change implemented?

How did you validate the change?

  • Explain how a reviewer can verify the change themselves
  • read the testing section in the bootstrapping doc
  • configure your environment with the required secrets
  • run make target
  • Integration tests -- what is covered, what cannot be covered;
    or, explain why there are no new tests
    • it is an acceptance test covering the bootstrapping command
  • Unit tests -- what is covered, what cannot be covered; are
    there tests that fail without the change?
  • not required: its a test change

Release notes
No

Documentation Changes

Added internal

Other follow ups

  • We need a follow up to integrate with with the smoke testing layer so we run it automatically.


err = schemeBuilder.AddToScheme(scheme)
//TODO use kube package as has also utils to create clients
scheme, err := kube.CreateScheme()
Copy link
Contributor Author

@enekofb enekofb Oct 20, 2023

Choose a reason for hiding this comment

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

@waleedhammam the kube package is the one in oss for managing kube clients, it is definitely useful to leverage as much as we can from it in the context of #3507

@enekofb enekofb added the exclude from release notes Use this label to exclude a PR from the release notes label Oct 23, 2023
@enekofb enekofb changed the title added bootstrap journey integration test added cli bootstrap journey acceptance test Oct 23, 2023
@enekofb enekofb marked this pull request as ready for review October 23, 2023 08:59
@@ -7,7 +7,7 @@ import (
"github.com/alecthomas/assert"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
"github.com/fluxcd/pkg/apis/meta"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1beta2 "github.com/fluxcd/source-controller/api/v1beta2"
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we use v1 for all, seems we're using v1 and v1beta2 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it depends on the resource on flux ga: gitrepositories is v1 and helmrepo are v1beta2 we should use the right one by resource.

)

// CreateKubeconfigFileForRestConfig creates a kubeconfig file so we could use it for calling any command with --kubeconfig pointing to it
func CreateKubeconfigFileForRestConfig(restConfig rest.Config) (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could move this file to test utils package
as we did with create fake client ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually i think the other way around: is using /test packages something best practice? i know i reviewed and approved, but i might have not realised on the path

Copy link
Contributor

@waleedhammam waleedhammam Oct 24, 2023

Choose a reason for hiding this comment

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

I think since they're generic methods it could useful somewhere else, noting so specific about bootstrapping IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 changed there

Copy link
Member

@Samra10 Samra10 left a comment

Choose a reason for hiding this comment

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

LGTM

@enekofb enekofb merged commit 0b4d1ef into main Oct 24, 2023
10 checks passed
@enekofb enekofb deleted the issues/3508 branch October 24, 2023 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude from release notes Use this label to exclude a PR from the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bootstrap cli: reduce integration test cases
3 participants