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
Larastan に自作 OSS ライブラリのテストをぶっ壊された話
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
mpyw
March 24, 2023
Programming
550
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Larastan に自作 OSS ライブラリのテストをぶっ壊された話
PHPerKaigi 2023 Day1 アンカンファレンス
mpyw
March 24, 2023
Transcript
25 slides
Larastan に自作 OSS ライブラリ のテストをぶっ壊された話 PHPerKaigi 2023 Day1 アンカンファレンス @mpyw
ある日,突然自作ライブラリのテストが壊れました
発端 PDO のエミュレーションを切り替えるテスト
発端 PDO のエミュレーションを切り替えるテスト RefreshDatabase はコネクションを解決してしまうが 使っていない
CI だけ何故か落ちるようになってしまった…
ローカルと CI の微妙な違い • ローカルでは…? ◦ vendor/bin/phpunit • CI では…?
◦ vendor/bin/phpstan ◦ vendor/bin/phpunit
ローカルと CI の微妙な違い • ローカルでは…? ◦ vendor/bin/phpunit • CI では…?
◦ vendor/bin/phpstan ◦ vendor/bin/phpunit PHPStan を走らせると その後のテストは何回実行しても落ちる
PHPStan の実行で何が起こったのか?
PHPStan の実行で何が起こったのか? orchestra/testbench はライブラリの テスト用に laravel/laravel をいい感じに 用意してくれるテストフレームワーク
Larastan くん勝手に vendor 配下触るの!?
差分を探す
差分を探す 新規作成された vendor 自体は怪しくなかった ↓ 既存ファイルが書き換えられているのでは…?
差分を探す
差分を探す パッケージディスカバリが走ってそう
Larastan がどこかのバージョンから パッケージディスカバリを orchestra/testbench 内 の laravel/laravel に対して行うようになった…
差分を探す orchestra/testbench が spatie/laravel-ray に依存している
サービスプロバイダから呼ばれる処理で… 立ち上げ時に DB::connection() を解決している
None
None
というか Larastan がお節介すぎるやろ…
nunomaduro/larastan/issues/1588 に立てました
nunomaduro/larastan/issues/1588 に立てました
laravel-ray 側で直すんかい!w
遅延評価されるように修正された(1日前)
まとめ • Larastan は勝手に orchestra/testbench 上の依存関係で パッケージディスカバリを実行してくる • DB::connection() が解決される副作用に限っては
spatie/laravel-ray 側で 修正されたが,本質的な問題に対する違和感は拭えない
More Decks by mpyw
See All by mpyw
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
530
推測するな、計測せよ New Relic × Laravel 実践
mpyw
4
2.1k
排他制御のためだけに渋々 Redis 使ってませんか?
mpyw
8
2.8k
MySQL/Postgres におけるトランザクション分離レベル
mpyw
24
7.1k
PhpStorm と Docker の壊し方 〜モジュラモノリスへの幻想と失敗〜
mpyw
4
2.6k
Other Decks in Programming
See All in Programming
imagewebp()の向こう側: WebPはなぜ JPEG・PNGより軽いのか
yuzneri
0
150
LLM 101
dalinaum
0
530
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
260
読みやすい!と評判(?)の発表の準備にかける私のこだわり
shoheimitani
0
160
SODA - FACT BOOK(EN)
sodainc
1
280
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
120
AI時代のIaC入門 〜なぜインフラをコードで管理したいのか?〜 / Introduction to IaC in the AI Era
akihisaikeda
6
1.6k
The Cost of the DOM
ypresto
1
140
Growing PicoRuby's Ecosystem on ESP32
yuuu
2
150
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
240
Getting Started with Vibe Coding
miccheng
0
250
Claude Codeのおかげでやりたいことがやれるようになったんだよォー!
sms_tech
0
190
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
Context Engineering - Making Every Token Count
addyosmani
9
1.3k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
The Cost Of JavaScript in 2023
addyosmani
56
10k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
750
How to Talk to Developers About Accessibility
jct
2
630
The Invisible Side of Design
smashingmag
301
52k
Skip the Path - Find Your Career Trail
mkilby
1
300
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
390
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1.1k