Kustomize: Testing framework for Windows

Created on 1 Mar 2019  路  24Comments  路  Source: kubernetes-sigs/kustomize

At the time of writing, commits to the repo only have to pass bin/pre-commit.sh, which currently runs only on linux.

Would be nice to have this script, or it's equivalent, run on a Windows node, so we could have more confidence in a Windows release.

edit: 21 aug 2019; would be happy to just have the unit tests being run on windows. linux / darwin tests also cover all the examples, but we can skip that for a windows release.

help wanted kinfeature lifecyclrotten

Most helpful comment

I can easily assist ( and have actually started it already ) to convert the shell script to powershell.
I have the skeleton working, but I am not familiar at all with knowing if the tests / linting are working correctly.

All 24 comments

I can easily assist ( and have actually started it already ) to convert the shell script to powershell.
I have the skeleton working, but I am not familiar at all with knowing if the tests / linting are working correctly.

Yes please! I took a swing at this but hit a wall, so would be great to have your expertise. FWIW, here are some of the issues I encountered with Windows:

  • [ ] Not sure if curl exists on windows (wget does and we could switch to that if need be)
  • [ ] Need to install tree command with choco
  • [ ] Lint script doesn't work because the GOOS name it gets isn't recognized

Instructions for windows on Travis

Adding OSX tests in #835

/assign kenmaglio

@pwittrock: GitHub didn't allow me to assign the following users: kenmaglio.

Note that only kubernetes-sigs members and repo collaborators can be assigned and that issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign kenmaglio

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@kenmaglio Please ping me or @monopole on Slack when you have a PR out. GitHub notifications are a firehose.

@kenmaglio let me know if you want help on this.

Hey @kenmaglio Thanks!

Beyond getting stuff to work in powershell, we also need a place to run it - and as Phil mentioned travis recently started to support windows.

The travis setup is here https://github.com/kubernetes-sigs/kustomize/blob/master/.travis.yml - apologies if that's all obvious. So it will need mods too.

I have a WIP PR - I have built a PowerShell script that replicates the same tests for windows.

WIP: Windows Pre-Commit #840

WIP: Windows Testing #852

Yes please! I took a swing at this but hit a wall, so would be great to have your expertise. FWIW, here are some of the issues I encountered with Windows:

* [ ]  Not sure if `curl` exists on windows (`wget` does and we could switch to that if need be)

* [ ]  Need to install `tree` command with choco

* [ ]  Lint script doesn't work because the GOOS name it gets isn't recognized

Instructions for windows on Travis

Adding OSX tests in #835

@pwittrock
So curl is replaced with a few different things in PowerShell.
Invoke-WebRequest, Invoke-RestRequest or for just downloading a file...

(New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')

The tree command I believe is the ability to do ./... ?
If so - built into PowerShell

I can't actually tell if the lint script is working or not, as I had to turn on verbose.
There's no output that I get - other than it spins stuff up, and reports success.

@brendandburns Please!
I'm going to be at a little bit of a loss trying to ensure these function run the same. And also getting Travis setup correctly. I utilize Jenkins and know that - but not yet delved into travis or appveyor.

fwiw, Azure Pipelines (https://azure.microsoft.com/en-us/services/devops/pipelines/) is also free for open source projects and has good windows support in case Travis doesn't work out (starting w/ Travis makes sense)

@brendandburns I have actually looked into that ( only because really it's old TFS which I've done a ton ). Only thing then is possibly getting it to pull the source from github and not it's own repo.

For those who don't have windows - just to see where I've gotten to thus far.
kustomze-test-run

@monopole Might need your assistance in understanding your mdrip test runner. Looks like in windows the file you're creating is trying to be accessed before the last handler is completely done.

Looked like a race condition on a temp file - can you paste the stack trace into the discussion on #840 please?

Sorry folks - my git fu wasn't strong and really messed up my last PR with a merge accidentally.
I want to keep history nice and clean, so I recreated my PR.

WIP: Windows Testing #852

Sorry I haven't had much time to work on the travis side of the PR. I hope to be able to look at is soon.

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

/remove-lifecycle stale

@alexeldeib Just saw your work referenced in https://github.com/kubernetes-sigs/kustomize/pull/1374#issuecomment-513506466

If you want to send a PR, i'd be happy to help get it in.

To be clear - lets just get the unit tests to run, and some kind of minimal test to run the binary merely to assure it gets built, and we can get a windows release out. No need to reproduce the mdrip-based example coverage (i think that would be too hard given the bash-isms and unix-isms in the example code blocks).

I see Windows binaries are out for 3.2.3, but Chocolatey is still at 2.0.3, anyone know of plans to upgrade this?

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Was this page helpful?
0 / 5 - 0 ratings