Slide 1

Slide 1 text

Go testing libraries Stephan Hagemann Pivotal Labs, Boulder

Slide 2

Slide 2 text

https://github.com/shageman/gotestit

Slide 3

Slide 3 text

Background

Slide 4

Slide 4 text

CloudFoundry http://blogs.vmware.com/vmware/2011/04/cloud-foundry-delivering-on-vmwares-open-paas-strategy.html

Slide 5

Slide 5 text

CloudFoundry Architecture http://docs.cloudfoundry.com/docs/running/architecture/

Slide 6

Slide 6 text

The Loggregator project Loggregator is the user application logging subsystem for Cloud Foundry. Loggregator allows users to: ● Tail their application logs. ● Dump a recent set of application logs (where recent is on the order of an hour). ● Continually drain their application logs to 3rd party log archive and analysis services.

Slide 7

Slide 7 text

Loggregator Architecture https://github.com/cloudfoundry/loggregator

Slide 8

Slide 8 text

Libraries

Slide 9

Slide 9 text

Tests vs Specs class TestMeme < Minitest::Test def setup @meme = Meme.new end def test_that_kitty_can_eat assert_equal "OHAI!", @meme.i_can_has_cheezburger? end def test_that_it_will_not_blend refute_match /^no/i, @meme.will_it_blend? end def test_that_will_be_skipped skip "test this later" end end describe Meme do before do @meme = Meme.new end describe "when asked about cheeseburgers" do it "must respond positively" do @meme.i_can_has_cheezburger?.must_equal "OHAI!" end end describe "when asked about blending possibilities" do it "won't say no" do @meme.will_it_blend?.wont_match /^no/i end end end https://github.com/seattlerb/minitest

Slide 10

Slide 10 text

Go testing libraries testing testify gocheck prettytest go-spec gospec mao zen

Slide 11

Slide 11 text

Licences testing testify gocheck prettytest go-spec gospec mao zen BSD MIT BSD MIT BSD Apache MIT Apache

Slide 12

Slide 12 text

Matchers

Slide 13

Slide 13 text

https://github.com/shageman/gotestit Sample tests

Slide 14

Slide 14 text

Summary testing testify gocheck prettytest go-spec gospec mao zen really basic, direct use tedious

Slide 15

Slide 15 text

Summary testing testify gocheck prettytest go-spec gospec mao zen really basic, direct use tedious lots of useful assertions

Slide 16

Slide 16 text

Summary testing testify gocheck prettytest go-spec gospec mao zen really basic, direct use tedious lots of useful assertions suites, before, after, lots of assertions

Slide 17

Slide 17 text

Summary testing testify gocheck prettytest go-spec gospec mao zen really basic, direct use tedious lots of useful assertions suites, before, after, lots of assertions suites, pretty

Slide 18

Slide 18 text

Summary testing testify gocheck prettytest go-spec gospec mao zen really basic, direct use tedious lots of useful assertions suites, before, after, lots of assertions suites, pretty doesn't work

Slide 19

Slide 19 text

Summary testing testify gocheck prettytest go-spec gospec mao zen really basic, direct use tedious lots of useful assertions suites, before, after, lots of assertions suites, pretty doesn't work Describe, expect, have to state all tests

Slide 20

Slide 20 text

Summary testing testify gocheck prettytest go-spec gospec mao zen really basic, direct use tedious lots of useful assertions suites, before, after, lots of assertions suites, pretty doesn't work Describe, expect, have to state all tests - desc, it, expect, basic assertions

Slide 21

Slide 21 text

Summary testing testify gocheck prettytest go-spec gospec mao zen really basic, direct use tedious lots of useful assertions suites, before, after, lots of assertions suites, pretty doesn't work Describe, expect, have to state all tests - desc, it, expect, basic assertions

Slide 22

Slide 22 text

Thanks!

Slide 23

Slide 23 text

travis

Slide 24

Slide 24 text

go test -- race

Slide 25

Slide 25 text

shared state

Slide 26

Slide 26 text

parallel