kubernetes-client / haskell

Haskell client for the kubernetes API. A work in progress.
Apache License 2.0
127 stars 59 forks source link

Add Integration tests #61

Closed akshaymankar closed 4 years ago

akshaymankar commented 5 years ago

Fixes #40

There are two tests which can also serve as exmaples:

  1. simple: reads KUBECONFIG from environment to create a client. Then uses the client to create a namespace and a deployment in the namespace. It then verifies if the deployment exists.
  2. in-cluster: assumes it is running in a cluster and creates a namespace.

Other changes to travis config:

  1. Use GHC 8.6.5 instead of 8.6.3.
  2. Use lts-14 instead of 13.
  3. Removed GHC 8.0.2 as it was not working after #60.
  4. Run all stack builds with --fast for speed and also to avoid travis timeout.
  5. Replace stack --install-ghc query locals with stack --system-ghc query locals in cabal builds. This removes unnecessary installation of ghc in ~/.stack.
  6. Remove all the commented out builds to reduce noise.
  7. Move default stack build on top to get quicker feedback on default way of building.

My travis-foo isn't great, so I couldn't figure out how to add jobs and also keep the matrix, so I just added to the matrix. If someone has a better idea, please feel free to suggest :)

Click here to see the last run of the config. It is fast because most things are cached, a new PR would take much longer to run.

For all of this to be useful we should either switch on travis builds for this repository or translate this work to prow. I saw a conversation about it here: https://github.com/kubernetes/org/issues/651. I looked at prow for a bit, seems like we can get much better parallelism(much needed) and also pr tooling (arguable if we need it). But we'd definitely miss the matrix feature, caching and osx builds.

Anyhoo, I think we should enable travis builds for now and consider translating separately. From the conversation linked above I understand only members of @kubernetes-client/haskell-admins can enable travis builds. So I request one of them to please do so :)

akshaymankar commented 5 years ago

/approve cancel

jonschoning commented 5 years ago

FYI, there is nothing wrong with ghc-8.0.2 .

It is with a bug introduced in time >= 1.9.1
https://github.com/haskell/time/issues/119

lts-4.7 is not on time-1.9.1 yet, so that's why we haven't seen the error in stack builds.

fejta-bot commented 4 years ago

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

akshaymankar commented 4 years ago

/remove-lifecycle stale

fejta-bot commented 4 years ago

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

k8s-ci-robot commented 4 years ago

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
akshaymankar commented 4 years ago

I am sorry this got stuck in the whole conversation about travis/prow. I think we should just merge the pull request and look at the prow separately.

/remove-lifecycle stale

fejta-bot commented 4 years ago

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

akshaymankar commented 4 years ago

/remove-lifecycle stale

jonschoning commented 4 years ago

/lgtm

jonschoning commented 4 years ago

/approve

k8s-ci-robot commented 4 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jonschoning

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-client/haskell/blob/master/OWNERS)~~ [jonschoning] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment