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.9k
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.8k
Design Pattern for Image and Text Composition in Go
timakin
5
6.5k
Golang API Testing the HARD way
timakin
13
6.4k
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
130
How Go cache
timakin
1
68
How Go cache tests
timakin
1
3k
Other Decks in Programming
See All in Programming
20241217 競争力強化とビジネス価値創出への挑戦:モノタロウのシステムモダナイズ、開発組織の進化と今後の展望
monotaro
PRO
0
280
盆栽転じて家具となる / Bonsai and Furnitures
aereal
0
1.9k
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
6
700
技術的負債と向き合うカイゼン活動を1年続けて分かった "持続可能" なプロダクト開発
yuichiro_serita
0
300
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
130
AppRouterを用いた大規模サービス開発におけるディレクトリ構成の変遷と問題点
eiganken
1
440
Beyond ORM
77web
11
1.6k
Fibonacci Function Gallery - Part 2
philipschwarz
PRO
0
210
rails newと同時に型を書く
aki19035vc
5
710
Findy Team+ Awardを受賞したかった!ベストプラクティス応募内容をふりかえり、開発生産性向上もふりかえる / Findy Team Plus Award BestPractice and DPE Retrospective 2024
honyanya
0
140
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
770
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
1.3k
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
335
57k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Faster Mobile Websites
deanohume
305
30k
Become a Pro
speakerdeck
PRO
26
5.1k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Measuring & Analyzing Core Web Vitals
bluesmoon
5
210
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
RailsConf 2023
tenderlove
29
970
No one is an island. Learnings from fostering a developers community.
thoeni
19
3.1k
The Cult of Friendly URLs
andyhume
78
6.1k
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!!