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

WIP - Development #6

Closed
wants to merge 6 commits into from
Closed

WIP - Development #6

wants to merge 6 commits into from

Conversation

kingdonb
Copy link
Member

@kingdonb kingdonb commented Feb 1, 2021

Commits on the development branch are automatically deployed through Jenkins

Kingdon Barrett added 6 commits February 1, 2021 14:10
yarn global add cdk8s-cli
$GIT_REPO - variable for development purposes

it will be handy to be able to swap out this git repository easily from
here in the script, so let's make it a variable parameter in the script.

Was on the fence about running: cdk8s import k8s inside of CI,
opted to run it upstream intead.

npm run compile will succeed as long as k8s.ts is included
tests are used to ensure smoke-test readiness but are not comprehensive

* add package-lock.json - there is an error from CI about npm version

* Generally do not commit synths/*.js
(except for synths/jest.config.js, which is full of test configuration)

* do not include compilation targets
Generated by npm run compile and they should not be committed in CI

* do not save __snapshots__/*.test.ts.snap

I am not sure how snapshots work but they are recommended as a test
strategy in the distro files from cdk8s.  I do not know how jest works
outside of basic things, will use it to write some tests maybe, or skip
it. (It would be better to test this with something comprehensive before
it is applied to the cluster, but maybe kustomization's health checking
is good enough to avoid a complex suite of tests upstream...)

https://openconstructfoundation.org/testing-cdk8s/

So we can see a problem in our generated output thanks to test failures,
the namespace has not been mentioned in the re-hydrated yaml from cdk8s.

Let's add a test that asserts we include the namespace, and include it.

* run the tests in CI
this should stop synths commit from being generated in event that it
failed the test (this is imperfect, but it's a useful mitigation)

* do not use snapshots for now
@kingdonb
Copy link
Member Author

kingdonb commented Feb 2, 2021

Ref: fluxcd/flux2#543 (comment)

@kingdonb
Copy link
Member Author

kingdonb commented Feb 2, 2021

This needs to be rebased and squashed with a signature to merge (closing)

@kingdonb kingdonb closed this Feb 2, 2021
@kingdonb kingdonb deleted the development branch February 2, 2021 14:11
@kingdonb kingdonb mentioned this pull request Feb 2, 2021
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.

1 participant