jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/396425 )
Change subject: Dev: Stop caching test HTTP responses by default ...................................................................... Dev: Stop caching test HTTP responses by default Let's leave it up to the developer to set this in an environment variable if desired. Change-Id: If3113027ff730ea6d1aa3398c869f197d5759e6e --- M README.md M test/utils/server.js 2 files changed, 9 insertions(+), 16 deletions(-) Approvals: BearND: Looks good to me, approved jenkins-bot: Verified diff --git a/README.md b/README.md index 9d4611c..d2613ec 100644 --- a/README.md +++ b/README.md @@ -118,18 +118,19 @@ This project takes advantage of HTTP request recording provided by the [sepia](https://www.npmjs.com/package/sepia) library to make running the tests much faster. -If no `VCR_MODE` variable is found in the environment or provided at the command line, -the tests will run with `VCR_MODE=cache`. After running for the first time, HTTP interactions -should be cached in the `fixtures/` folder. The next time you run the tests, they should use -the cached fixtures and run faster. - -To skip the cached fixtures, provide an unexpected VCR_MODE value from the command line, e.g.: +To take advantage of HTTP response caching, either set an environment variable +`VCR_MODE=cache`, or specify at the command line when running the tests: ``` -VCR_MODE=off npm test +VCR_MODE=cache npm test ``` -To get fresh fixtures just remove the `fixtures` folder and re-run the tests. +After running for the first time with `VCR_MODE=cache`, HTTP interactions should be cached +in the `fixtures/` folder. The next time you run the tests, they should use the cached +fixtures and run faster. + +To skip the cached fixtures, run the tests with an unexpected VCR_MODE value (e.g., +`VCR_MODE=off`) or just remove the `fixtures` folder and re-run. See [sepia](https://www.npmjs.com/package/sepia) for more documentation. diff --git a/test/utils/server.js b/test/utils/server.js index ba33769..d898f3b 100644 --- a/test/utils/server.js +++ b/test/utils/server.js @@ -1,14 +1,6 @@ 'use strict'; -// Default to recording+replaying http fixtures, -// only if we are not running in Docker -if (process.env.IN_DOCKER) { - process.env.VCR_MODE = undefined; -} else { - process.env.VCR_MODE = process.env.VCR_MODE || 'cache'; -} - const BBPromise = require('bluebird'); const ServiceRunner = require('service-runner'); const logStream = require('./logStream'); -- To view, visit https://gerrit.wikimedia.org/r/396425 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If3113027ff730ea6d1aa3398c869f197d5759e6e Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: Mholloway <[email protected]> Gerrit-Reviewer: BearND <[email protected]> Gerrit-Reviewer: Fjalapeno <[email protected]> Gerrit-Reviewer: Jdlrobson <[email protected]> Gerrit-Reviewer: Mholloway <[email protected]> Gerrit-Reviewer: Mhurd <[email protected]> Gerrit-Reviewer: Ppchelko <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
