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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Seiji Takahashi
December 11, 2017
Programming
2
6.8k
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
権限と承認 〜ユーザー信頼性に繋がる管理画面の根幹について〜
timakin
0
780
Go Backends for frontends with GraphQL and gRPC
timakin
6
4.2k
Design Pattern for Image and Text Composition in Go
timakin
5
6.8k
Golang API Testing the HARD way
timakin
13
7k
Head First Golang Image Package
timakin
2
10k
React Native Beyond Prototype
timakin
2
1.7k
Performance Optimization on Google AppEngine
timakin
5
6.6k
testcache.pdf
timakin
1
200
How Go cache
timakin
1
120
Other Decks in Programming
See All in Programming
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
210
Unity6.3 AudioUpdate
cova8bitdots
0
120
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
160
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
890
クライアントワークでSREをするということ。あるいは事業会社におけるSREと同じこと・違うこと
nnaka2992
1
330
TipKitTips
ktcryomm
0
160
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
15
8.5k
CSC307 Lecture 14
javiergs
PRO
0
470
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.5k
手戻りゼロ? Spec Driven Developmentとは@KAG AI week
tmhirai
1
190
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
820
How to stabilize UI tests using XCTest
akkeylab
0
110
Featured
See All Featured
Making Projects Easy
brettharned
120
6.6k
[SF Ruby Conf 2025] Rails X
palkan
2
820
Marketing to machines
jonoalderson
1
5k
A better future with KSS
kneath
240
18k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
150
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
The Language of Interfaces
destraynor
162
26k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
1.9k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
290
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.3k
Tell your own story through comics
letsgokoyo
1
840
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
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!!