Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
「再現ケース」の必要性とその難しさ
Search
Yasuo Honda
July 04, 2020
Technology
680
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
「再現ケース」の必要性とその難しさ
銀座Rails#23
Yasuo Honda
July 04, 2020
More Decks by Yasuo Honda
See All by Yasuo Honda
PostgreSQL 18のNOT ENFORCEDな制約とDEFERRABLEの関係
yahonda
1
390
私のRails開発環境
yahonda
0
260
Railsの話をしよう
yahonda
0
300
RailsのPostgreSQL 18対応
yahonda
0
4.1k
Contributing to Rails? Start with the Gems You Already Use
yahonda
2
270
PostgreSQL 18 cancel request key長の変更とRailsへの関連
yahonda
0
340
extensionとschema
yahonda
1
380
NOT VALIDな検査制約 / check constraint that is not valid
yahonda
1
330
今、始める、第一歩。 / Your first step
yahonda
3
1.6k
Other Decks in Technology
See All in Technology
[AWS 秋のクラウドオペレーション祭り 2026]AWS DevOps Agentで変わるリリースと運用対応 ~リリース管理機能と Directed actions のご紹介~
furuton
3
950
ファミコンでPHPを動かす / PHP on the Famicom side b
tomzoh
0
140
生成AIで高い生産性を求められて、 悩み、乗り越えた話
mot_techtalk
2
130
生成AIを使って「人が」考える技術 ― AI時代の人機共想と実践ノウハウ|UNITT AC2026
ishiirikie
0
560
分析の民主化を支えるメタデータ整備の実践
kakehashi
PRO
0
170
インバスケット試験対策アプリを 作って見えたAIエージェント構築 ナレッジ2選
shichijoyuhi
1
130
自主式軟體工廠
philipz
0
230
カンファレンスに参加した後の浮遊感とセルフケア
pauli
0
310
Google Cloud Next Tokyo 26登壇時のスクリプト
recruitengineers
PRO
0
200
ai_cording_with_k8s_knowledge.pdf
mochizuki875
1
300
MCPゲートウェイを作って運用してわかったこと — Agent時代の権限管理の現在地
mtpooh
10
3.1k
オブザーバビリティを高める AI エージェント体験を考える / Designing AI Agent Experiences That Enhance Observability
aoto
PRO
2
310
Featured
See All Featured
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
930
RailsConf 2023
tenderlove
30
1.6k
The SEO Collaboration Effect
kristinabergwall1
1
590
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
2k
The SEO identity crisis: Don't let AI make you average
varn
0
580
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
530
Everyday Curiosity
cassininazir
0
340
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
250
Transcript
銀座Rails#23 July 4, 2020 Yasuo Honda @yahonda 「再現ケース」の必要性とそ の難しさ
• 依存するライブラリやプログラムの変更で、アプリケーションやフレーム ワークに問題が出たときに、どうレポートするか • Rubyの変更でRailsのCIが落ちたときの例を元にうまくいったこと、うまく いかなかったこと • 技術的な側面よりも、どのように考えるか、どのように行動するかをお話し します 話すこと
• 開発中のRubyの変更で、開発中のRailsのCIが落ちることがある ◦ https://buildkite.com/rails/rails/builds?branch=master • Ruby 2.8.0dev ◦ 1日1回更新される rubylang/ruby:master-nightly-bionic
◦ 詳細は How to git bisect ruby/ruby repository 参照 RailsのCI
• Rubyのどのcommitが現象を引き起こしたか特定する ◦ git bisect を利用 ◦ How to git
bisect ruby/ruby repository 参照のこと • 現象が再現する手順を確立する ◦ minitest_bisect を利用する ◦ https://gist.github.com/yahonda/b67b19304d34fc1150a9db 79ee325bcc 参照のこと ◦ この時点ではRubyにとって”ミニマムな”再現手順ではない ◦ "ミニマム"の意味はリポジトリにより異なる Rubyの変更でRailsのCIが落ちたらやること
• 考えられる選択は以下のいずれか • 現象が発生したRailsのissues ◦ Issues · rails/rails · GitHub
• 現象を引き起こした(と報告時点では考えている) Rubyのissues ◦ Ruby Issue Tracking System 再現できたらどこにレポートするか
• 現象が発生したレポジトリ ◦ 私はずっとこうしていた(Railsのissueとして報告していた) • いいところ ◦ 再現ケースはRailsのUnit testなので、Railsフレームワーク開発者 にとってなじみがある(ミニマムなテストケースといえる)
• よくないところ ◦ Rubyの非互換性の可能性があっても、Rails側で「直してしまう」場合 がある 再現できたらどこにレポートするか(2)
• 現象のきっかけとなったレポジトリ ◦ いまはこうしています(bugs.ruby-lang.orgにまずレポート) • いいところ ◦ Ruby開発者にRubyの非互換性や問題を直接レポートできる ◦ 非互換性や問題はRuby開発者が意図している場合と意図していな
い場合があることがわかる ◦ Rubyが直る場合とRailsが修正される場合がある ▪ 意図しているRubyの非互換性であれば、現象が発生したレポジ トリ(Rails)で修正を行うことになる 再現できたらどこにレポートするか(3)
• よくないところ(難しいところ): ◦ ミニマムな再現ケースを作りにくい ◦ Ruby開発者にとってはRailsフレームワークのunit testはミニマム ではない ◦ Railsのunit
testをplainなRubyでの再現ケースにするのは大変 ▪ 私自身ほとんどできていない • Note: 100%の再現性を特定できていない場合 ◦ 現象が発生したレポジトリで、再現性を高めるための情報を得ましょ う 再現できたらどこにレポートするか(4)
実際の例2つ
• 最初はRailsにレポートした ◦ Action Text and Action View unit tests
are failing with ruby 2.8.0dev · Issue #38613 · rails/rails ▪ NoMethodError: undefined method `runnables' for ActiveJob::Base:Class • 2日後にRubyにレポートした ◦ https://bugs.ruby-lang.org/issues/16669 Case 1
• よかったこと ◦ Rubyが修正された ▪ https://github.com/ruby/ruby/commit/8119bcbf ▪ https://ruby-trunk-changes.hatenablog.com/entry/rub y_trunk_changes_20200423 に解説があります
• “defined? で undef したメソッドも "method" になってし まっていた” ◦ あたらしいRubyのビルドのきっかけになった ▪ 後で話します Case 1 (2)
• うまくいかなかったこと ◦ bin/testでは再現し、bundle exec rubyでは再現しない違いに気 づいていたが、Ruby(Without Rails)で再現ケースを作れなかった ▪ https://github.com/rails/rails/issues/38613#issuecom
ment-595285939 ◦ ミニマムな再現ケース(7行) ▪ https://twitter.com/kamipo/status/12528819301035581 44 Case 1 (3)
• うまくいかなかったこと ◦ minitest の--seedを固定しても、テスト実行順が固定化されなかっ た(再現したりしなかったりする原因) ◦ RailsのParallel testingがAction ViewとAction
Packで有効に なっているのに気づくのに時間がかかった ▪ Railsガイドを修正しました ▪ [skip ci] How to run Action View and Action Pack unit test in serial · Issue #38693 · rails/rails Case 1 (3)
• 最初からRubyにレポートした ◦ https://bugs.ruby-lang.org/issues/16973 ▪ ActiveSupportのto_jsonのテストが落ちる • Railsのbug templateを参考にしたRubyスクリプトにした ◦
Railsリポジトリをクローンしなくても再現できる ◦ https://github.com/rails/rails/blob/master/guides/bug_rep ort_templates/generic_master.rb ◦ gem "activesupport" - Plain Rubyスクリプトには遠い Case 2
• よかったこと ◦ 意図通りで、3rd party issueとしてクローズされた ▪ https://github.com/ruby/ruby/commit/41582d5866 ▪ https://ruby-trunk-changes.hatenablog.com/entry/rub
y_trunk_changes_20200619 に解説があります ◦ Ruby側の判断を受けて、Railsが修正されました ▪ https://github.com/rails/rails/pull/39697 Case 2 (2)
• よかったこと ◦ 再現ケースを小さくしたり、print debugの結果を更新していたら、 Railsの該当コードレビューワーからコメントがもらえた ◦ http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-cor e/98900 •
うまくいかなかったこと ◦ "Without Active Support"での再現ケースはつくれなかった ◦ それでも事象が解消されたことのほうが重要ではあります Case 2 (3)
最近追加されたRubyのビルド
• https://bugs.ruby-lang.org/issues/16895 が報告され、debug build(-DRUBY_DEBUG=1)つきRuby 2.8.0devが利用可能になった ◦ GitHub Actions: ruby-debug ◦
Docker Image: rubylang/ruby:master-debug-nightly-bionic • Railsでは下記のpull requestがopen ◦ https://github.com/rails/buildkite-config/pull/9 • Oracle enhanced adapterでは導入済み ◦ https://github.com/rsim/oracle-enhanced/pull/2015 最近追加されたRubyのビルド
Thank you