mrtnzlml-archive / testbench

:green_apple: Simple integration testing tool for Nette applications
http://zlml.cz/jednoduche-testovani-pro-uplne-kazdeho
41 stars 13 forks source link

Rozdělení testů na rychlé a pomalé (RUNLEVEL) #9

Closed mrtnzlml closed 8 years ago

mrtnzlml commented 8 years ago

viz https://forum.nette.org/cs/22634-rozdeleni-testu-na-rychle-pomale-resp-jednotkove-integracni#p153837 Nějaké jednoduché nastavení runlevelu u jednotlivých testů (ne na úrovni celého TestCase).

if ((int)getenv('RUNLEVEL') < 5) {
    \Tester\Environment::skip('Required runlevel 5.');
}

Následné spuštění jen pomocí: RUNLEVEL=10 vendor/bin/run-tests

mrtnzlml commented 8 years ago

Nyní je možné označit test pomocí $this->changeRunLevel(\Testbench::SLOW); resp $this->changeRunLevel(10); což daný test přeskočí dokud nebude spuštěn s RUNLEVEL proměnnou prostředí: RUNLEVEL=10 vendor/bin/run-tests ...