Skip to content

Instantly share code, notes, and snippets.

View williammartin's full-sized avatar

William Martin williammartin

View GitHub Profile

Given some disagreement on cloudfoundry/servicebroker#628 about the need for arbitrary data to describe the changes in some particular maintenance, I'd like to propose we tackle this problem in two steps.

What are the problem statements?

  1. As an application developer, I want to be able to update my own service instances when convenient to me, so that I can schedule downtime.
  2. As a platform operator, I want to be able to update out of date service instances, so I can manage offerings reasonably.

What is required to support this?

  1. There MUST be some indication that an update is available for a service instance
@williammartin
williammartin / hieararchy.go
Last active June 20, 2019 09:42
Effective Ginkgo/Gomega Example
var _ = Describe("running a binary", func() {
var (
args []string
session *Session
)
BeforeEach(func() {
args = []string{}
})
@williammartin
williammartin / beforeeach.go
Created June 20, 2019 09:43
Effective Ginkgo/Gomega BeforeEach Example
Describe("running the foo command", func() {
BeforeEach(func() {
args = append(args, "foo")
})
When("--help is passed", func() {
BeforeEach(func() {
args = append(args, "--help")
})
@williammartin
williammartin / readall.go
Created June 20, 2019 09:44
Effective Ginkgo/Gomega helper example
func readAll(r io.Reader) []byte {
content, err := ioutil.ReadAll(r)
ExpectWithOffset(1, err).NotTo(HaveOccurred())
return content
}
@williammartin
williammartin / readall.go
Created June 20, 2019 09:44
Effective Ginkgo/Gomega dot import example
ginkgo.Describe("a command", func() {
var session *gexec.Session
ginkgo.Context("when it runs", func() {
ginkgo.BeforeEach(func() {
session = run()
})
ginkgo.It("exits successfully with a message", func() {
gomega.Eventually(session).Should(gexec.Exit(0))
var _ = Describe("ginkgotcha", func() {
var number int = 10
It("is equal to 10", func() {
Expect(number).To(Equal(10))
})
When("the number is set to 42", func() {
BeforeEach(func() {
number = 42
var _ = Describe("ginkgotcha", func() {
var number int
BeforeEach(func() {
number = 10
})
It("is equal to 10", func() {
Expect(number).To(Equal(10))
})
var _ = Describe("ginkgotcha", func() {
It("leaks a goroutine", func() {
go func() {
defer GinkgoRecover()
time.Sleep(time.Second / 2)
Fail("lol play time is over")
}()
})
It("is gonna have a bad time", func() {
var _ = Describe("ginkgotcha", func() {
It("is irregular", func() {
buffer := BufferWithBytes([]byte("map[string]"))
Expect(buffer).To(Say("map[string]"))
})
})
openapi: "3.0.0"
info:
version: 1.0.1
title: Swagger Petstore
license:
name: MIT
servers:
- url: http://petstore.swagger.io/v1
paths:
/pets: