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
mpyw
March 24, 2023
Programming
530
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Larastan に自作 OSS ライブラリのテストをぶっ壊された話
PHPerKaigi 2023 Day1 アンカンファレンス
mpyw
March 24, 2023
More Decks by mpyw
See All by mpyw
推測するな、計測せよ New Relic × Laravel 実践
mpyw
4
2k
排他制御のためだけに渋々 Redis 使ってませんか?
mpyw
8
2.7k
MySQL/Postgres におけるトランザクション分離レベル
mpyw
24
7k
PhpStorm と Docker の壊し方 〜モジュラモノリスへの幻想と失敗〜
mpyw
4
2.6k
Other Decks in Programming
See All in Programming
週末にAI-DLCを本気で回したら$1,600溶けた
hbashimizu
0
130
ALB ログから Trace を気合で繋げる技術
fohte
7
880
デプロイ直後のレイテンシスパイクを調べたら、 Railsの仕様にたどり着いた
nhsykym
0
110
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
150
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
280
Press start. Python's next generation.
willingc
PRO
3
330
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
130
AIは賢い。でも実行環境は? CLIおじさんがAI時代に伝えたいこと ~ CLIおじさんがAI時代に伝えたいこと ~
curekoshimizu
1
220
ソフトウェアラスタライザ
fadis
1
800
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
4
1.1k
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
270
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
590
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Context Engineering - Making Every Token Count
addyosmani
9
1.1k
For a Future-Friendly Web
brad_frost
183
10k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
710
The Mindset for Success: Future Career Progression
greggifford
PRO
0
490
4 Signs Your Business is Dying
shpigford
187
23k
ラッコキーワード サービス紹介資料
rakko
1
4.8M
The Cost Of JavaScript in 2023
addyosmani
55
10k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
510
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
Transcript
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 側で 修正されたが,本質的な問題に対する違和感は拭えない