Repository navigation
Odstráň duplicitné testy a zbytočné čakanie v CI - #922
Merged
Merged
Conversation
celuchmarek
approved these changes
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
CI zbytočne opakuje integračné testy a dva browser testy vždy čakajú na vypršanie päťsekundového timeoutu, hoci je očakávaný stav už splnený. Predlžuje to spätnú väzbu bez dodatočného pokrytia.
Solution
rails test:integration: predchádzajúcirails testuž tieto testy zahŕňa. Profilovaním bolo overené, že všetkých 137 integračných testov sa objavilo v oboch behoch. Browser testy naďalej bežia samostatne cezrails test:system; zachované zostáva aj nahrávanie logov a screenshotov pri zlyhaní.assert_not has_link?zaassert_no_link. Pôvodný pozitívny predicate pri chýbajúcom odkaze čakal celý timeout. Negatívna assertion priamo overuje neprítomnosť a stále zachováva Capybara synchronizáciu, ak treba počkať na zmiznutie odkazu. Globálny timeout sa nemení.Produkčný kód, autentifikácia ani rozsah pokrytia sa nemenia. Profiler a meracie skripty nie sú súčasťou PR.
Meranie
Kontrolovaný lokálny experiment s rovnakými dvoma testami, rovnakým profilerom a seedom
59674, spustený postupne na jednom stroji:Úspora je približne 10 sekúnd na tejto dvojici. Odstránený integračný krok v referenčnom CI behu trval ďalších 19 sekúnd vrátane štartu aplikácie. Nie je to tvrdenie násobného zrýchlenia celej sady; nový celkový čas musí potvrdiť CI.
Overenie:
bundle exec rails test --seed 59674abundle exec rails test:system --seed 59674.Celé lokálne overenie finálnej vetvy prešlo:
rails test: 606 testov, 1 661 assertions, 0 zlyhaní, 0 chýb, 3 skips, čas testov 22,75 s.rails test:system: 87 testov, 603 assertions, 0 zlyhaní, 0 chýb, čas testov 71,22 s.Demo
Not applicable — optimalizácia testov a CI bez zmeny používateľského rozhrania. Výsledky merania sú uvedené vyššie.