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.7k
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.6k
Design Pattern for Image and Text Composition in Go
timakin
5
6.3k
Golang API Testing the HARD way
timakin
13
6.2k
Head First Golang Image Package
timakin
2
9.7k
React Native Beyond Prototype
timakin
2
1.5k
Performance Optimization on Google AppEngine
timakin
5
6k
testcache.pdf
timakin
1
110
How Go cache
timakin
1
60
How Go cache tests
timakin
1
2.8k
Other Decks in Programming
See All in Programming
AWS CDKにおける「再利用性」を考える / aws-cdk-reusability
gotok365
6
1.3k
Terraformテスト入門
msato
0
530
さきがけから振り返るアーキテクチャ刷新 / Reflecting on the Architectural Renewal from the Vanguard
nrslib
2
770
君たちはどうコードをレビューする (される) か / 大吉祥寺.pm
utgwkk
15
8.5k
I/O Extended Android in Korea 2024 ~ Whats new in Android development tools
pluu
0
250
Modern Angular: Renovation for Your Applications
manfredsteyer
PRO
0
140
Architectures with Lightweight Stores: New Rules and Options
manfredsteyer
PRO
0
100
今こそ始める、CDKコンストラクトライブラリ開発 ― 入門から実践まで
tmokmss
1
930
3 Effective Rules for Success with Signals in Angular
manfredsteyer
PRO
0
120
リハビリmruby
kishima
1
160
小さな開発会社を作った理由
polidog
0
1.9k
CSC307 Lecture 06
javiergs
PRO
0
360
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
399
65k
[RailsConf 2023] Rails as a piece of cake
palkan
35
4.4k
Fontdeck: Realign not Redesign
paulrobertlloyd
79
5.1k
Web development in the modern age
philhawksworth
203
10k
Atom: Resistance is Futile
akmur
261
25k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
29
2.5k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
189
16k
Writing Fast Ruby
sferik
623
60k
Automating Front-end Workflow
addyosmani
1362
200k
Debugging Ruby Performance
tmm1
71
11k
No one is an island. Learnings from fostering a developers community.
thoeni
17
2.8k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
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!!