Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
How Go test tests
Search
Seiji Takahashi
December 11, 2017
Programming
2
4.6k
How Go test tests
Presentation for golang.tokyo #11
Seiji Takahashi
December 11, 2017
Tweet
Share
More Decks by Seiji Takahashi
See All by Seiji Takahashi
Go Backends for frontends with GraphQL and gRPC
timakin
6
3.5k
Design Pattern for Image and Text Composition in Go
timakin
5
6.3k
Golang API Testing the HARD way
timakin
13
6.1k
Head First Golang Image Package
timakin
2
9.6k
React Native Beyond Prototype
timakin
2
1.5k
Performance Optimization on Google AppEngine
timakin
5
5.9k
testcache.pdf
timakin
1
98
How Go cache
timakin
1
57
How Go cache tests
timakin
1
2.7k
Other Decks in Programming
See All in Programming
pixivアプリでマルチモジュールを実現するまで
gatosyocora
1
130
受託開発でGitLab CI を活用していく
xiombatsg
1
270
Micro Frontends for Java Microservices - Devnexus 2024
mraible
PRO
0
430
VSCodeでのDatabricks開発もお勧めしたい/I would also recommend Databricks development with VSCode.
kazumain
0
240
Folding Cheat Sheet #3
philipschwarz
PRO
0
120
Rails と人魚の話/rails-and-mermaid
sanfrecce_osaka
0
100
"config" ってなんだ? / What is "config"?
okashoi
0
220
Hanami and htmx
bkuhlmann
0
190
Semantic search with Django and pgvector
pauloxnet
0
240
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
180
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
120
Elm 0.19.0 Changes
bkuhlmann
0
490
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
397
65k
Designing on Purpose - Digital PM Summit 2013
jponch
110
6.4k
Fontdeck: Realign not Redesign
paulrobertlloyd
76
4.9k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
19
1.9k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
115
18k
Building a Modern Day E-commerce SEO Strategy
aleyda
16
6.4k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
124
32k
How GitHub (no longer) Works
holman
304
140k
Clear Off the Table
cherdarchuk
83
310k
Automating Front-end Workflow
addyosmani
1355
200k
Music & Morning Musume
bryan
41
5.6k
Transcript
How Go test tests @__timakin__
• Seiji Takahashi • Github: timakin / Twitter: @__timakin__ •
גࣜձࣾGunosy ৽نࣄۀ։ൃࣨ • Go / Swift ࣗݾհ
Copyright© Gunosy Inc. All Rights Reserved 3 Go / Python
ΤϯδχΞืूத ▶https://gunosy.co.jp/recruit/ Gunosyɺ౦ژେֶʹ௨͏3ਓͷֶੜͷ ʮใΛੈքதͷਓʹ࠷దʹಧ͚͍ͨʯͱ͍͏͍͔Β࢝·Γ·ͨ͠ɻ ౦ূϚβʔζ্ɺຊώϧζͷΦϑΟεҠసΛܦͯɺ େ͖͍ͯ͘͠ΔձࣾͰ׆༂͍ͨ͠ϝϯόʔΛืू͍ͯ͠·͢ɻ
Test of test
None
Go1.9~ ͕ؔͲΜͳग़ྗΛ͢Δͷ͔ɺ ExampleΛఆٛͰ͖ΔΑ͏ʹ
None
None
TestίϚϯυʹؔΘΔ࣮ • src/testing • ςετ࣮ߦ࣌ʹ͏T, BͳͲͷ࣮ • testing.commonͱ͍͏ߏମ͕ϝΠϯϩδοΫΛ͍࣋ͬͯΔ • ίϚϯυͷflagύʔε
• benchmarking, ΧόϨοδଌఆͳͲ • Fail, SkipͳͲͷ࣮
common
None
গͳ͍ʂ؆୯ʂ
Mergeͯ͠΄͍͠ʂ
Can you add tests?
ςετͷ࣮ߦ݁Ռͬͯ Ͳ͏ͬͯ ςετ͢ΔΜͩʁ
ςετͬͯͲ͏ͬͯ ςετ͢ΔΜͩʁ
For testing tests • src/cmd/go/go_test.go • Go commandsͷςετ࣮ߦ
For testing tests • src/cmd/go/go_test.go • Go commandsͷςετ࣮ߦ
For testing tests • testgoData • ͍͍ײ͡ʹfixtureΛಡΈࠐΜͩΓɺ ࣮ߦޙͷCleanupΛͯ͘͠ΕΔ
For testing tests • src/cmd/go/testdata/src/* • ςετ༻ͷFixtureΛఆٛ
all.bashΛճͤ ສࣄOK
Let’s Contribute!
ʕ ◔ϖ◔ʔ < Thank You!!