Test X by Controlling X

So third is the question "how easy can I control X". The StackOverflow question that Shepmaster was answering was about environment variables (env vars). They are reasonably easy to control in most tests (in most languages and frameworks). But harder when you run tests in parallel because all running tests will re-use the same shared env-vars. If test 1 sets env var "URL" to "http://localhost:3000" and test 2 sets it to "http://example.com", there will be conflicts. Other difficulties are that a service you are testing, may need to be restarted to pick up a change to an environment variable, or that environment variables are enforced or overridden by your OS, CI, or hosting.
Test X by Controlling X #ruby #rubydeveloper #rubyonrails #test https://rubyonrails.ba/single/test-x-by-controlling-x

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles