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
5k
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.9k
Design Pattern for Image and Text Composition in Go
timakin
5
6.6k
Golang API Testing the HARD way
timakin
13
6.5k
Head First Golang Image Package
timakin
2
10k
React Native Beyond Prototype
timakin
2
1.6k
Performance Optimization on Google AppEngine
timakin
5
6.2k
testcache.pdf
timakin
1
140
How Go cache
timakin
1
79
How Go cache tests
timakin
1
3k
Other Decks in Programming
See All in Programming
プログラミング教育のコスパの話
superkinoko
0
130
AI Agents with JavaScript
slobodan
0
180
Windows版PHPのビルド手順とPHP 8.4における変更点
matsuo_atsushi
0
370
海外のアプリで見かけたかっこいいTransitionを真似てみる
shogotakasaki
1
130
PHPのガベージコレクションを深掘りしよう
rinchoku
0
250
Develop Faster With FrankenPHP
dunglas
2
2.8k
WordPress Playground for Developers
iambherulal
0
120
Devin入門と最近のアップデートから見るDevinの進化 / Introduction to Devin and the Evolution of Devin as Seen in Recent Update
rkaga
8
4k
ベクトル検索システムの気持ち
monochromegane
30
9.4k
Kubernetesで実現できるPlatform Engineering の現在地
nwiizo
3
1.8k
Boost Your Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
480
remix + cloudflare workers (DO) docker上でいい感じに開発する
yoshidatomoaki
0
120
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
28
1.6k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
31
4.8k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.5k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.3k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
118
51k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
8
710
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
12
1.4k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Speed Design
sergeychernyshev
28
870
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!!