Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to override everything using environment variables #5

Merged
merged 3 commits into from Jan 24, 2018

Conversation

dawehner
Copy link

  • Right now settings.json values win over environment variables
  • This makes it hard for testbot to change the configuration bits.
  • As alternative every setting is now pulled from the environment first.

I would need to do some more testing

@@ -1,13 +1,13 @@
const settings = require('./nightwatch.settings.json');
const env = require('./core/tests/Drupal/Nightwatch/env');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured it out. This is already in the core dir, so ./core is redundant


const env = {};

if (!fs.fileExistsSync('../../../nightwatch.settings.json')) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be fs.existsSync('nightwatch.settings.json') -> process.cwd() says its in /var/www/html/core already, and is not relative to the directory that env.js exists in.

}
});

module.export = env;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be
module.exports = env;

the ./core directory was redundant
small typo
@ryanaslett
Copy link
Collaborator

Okay, so it doesnt work with a sqlite url: DB_URL=sqlite://localhost/sites/default/files/db.sqlite

@ryanaslett
Copy link
Collaborator

Here's a functioning mysql report. https://dispatcher.drupalci.org/job/drupalci_test_containers/929/testReport/#

Looks like the test passed and we've got nightwatch tests, yay! (see the console log) https://dispatcher.drupalci.org/job/drupalci_test_containers/929/console

There are some tests that fail now, probably because they rampage through the filesystem and find new things that werent there before, like .travis.yml files inside of the node_modules folder. So we're probably going to want to configure node_modules and the node cache to exist outside of the docroot.

@dawehner dawehner merged commit e4c7d3e into nightwatch Jan 24, 2018
@dawehner
Copy link
Author

Let's merge it and figure out where the sqlite bit doesn't work.

@dawehner dawehner deleted the env-variables branch January 24, 2018 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants