Solves many issues caused by config variables persisted. On a clean install these vars can (are) set by running the tests with environment vars. This allows our CI environment to install and test using only environment variables. However, on the next run the values stored in the config will be used instead of environment variables. This is frustrating and confusing to the local developer, if they expect to use environment variables. The frustration is compounded because resource-server from this repo is used by other samples in their testing. So failure to respect environment vars from the shell causes these other sample projects to attempt editing of the resource-server's config file! A much simpler solution is for the projects in this repo to always respect environment variables.
This PR removes the idea of .samples.config.json and replaces it with a new file config.js which uses variables from process.env. They must be defined in the shell as env vars or persisted in a single file: testenv
removes postinstall step, default-config.js and replace logic in updateConfig function
no more editing of .samples.config.js (file is unused now)
throws if required environment vars are not set before running test
support for an optional testenv file to persist environment values
Solves many issues caused by config variables persisted. On a clean install these vars can (are) set by running the tests with environment vars. This allows our CI environment to install and test using only environment variables. However, on the next run the values stored in the config will be used instead of environment variables. This is frustrating and confusing to the local developer, if they expect to use environment variables. The frustration is compounded because
resource-server
from this repo is used by other samples in their testing. So failure to respect environment vars from the shell causes these other sample projects to attempt editing of the resource-server's config file! A much simpler solution is for the projects in this repo to always respect environment variables.This PR removes the idea of
.samples.config.json
and replaces it with a new fileconfig.js
which uses variables fromprocess.env
. They must be defined in the shell as env vars or persisted in a single file:testenv
postinstall
step,default-config.js
and replace logic inupdateConfig
function.samples.config.js
(file is unused now)testenv
file to persist environment values