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

Runner Environment Variables seem to mangle Base64 Values #742

Closed
andrewconnell opened this issue Aug 12, 2016 · 3 comments
Closed

Runner Environment Variables seem to mangle Base64 Values #742

andrewconnell opened this issue Aug 12, 2016 · 3 comments
Labels

Comments

@andrewconnell
Copy link

andrewconnell commented Aug 12, 2016

Issue description or question

My app heavily leverages on environment variables for configuration (microservice based app). Some of the values I have to pass in are base64 strings. Setting these values from the command line (without wallaby) works just fine, both in running the app & in running the tests.

However, when running it in Wallaby, it seems that the string is getting malformed... suspect due to the presence of equal signs in the Base64 string. One of the strings I pass in always has two = on the end... but when the tests get the string from the environment variable, they two trailing = are missing... yet when I run it outside of wallaby, it breaks.

Could it be that internally you're splitting the env vars up from name=value on the equals sign? When I replace those two characters with underscores, my test can see those two characters just fine.

Wallaby.js configuration file

Including only the part for the runner...

        this.env = {
            type: 'node',
            params: {
                env: 'ACCOUNT_KEY=yeRWCr2p6r5Y+IDWsOqhFZIv7y54Nae1rr8CtWPJRpCOQmS5GTR4jjdOolNsTSQPAiS03usyXl0ZqXRmvUPWYA==;ACCOUNT_ID=someValue'
            }
        };

Code editor or IDE name and version

Visual Studio Code v1.4.0

OS name and version

OSX v10.11.6

@ArtemGovorov
Copy link
Member

Could it be that internally you're splitting the env vars up from name=value on the equals sign

It does sound like a bug.

There's an easy workaround for node env variables:

this.env = {
            type: 'node'
        };
process.env.ACCOUNT_KEY = 'yeRWCr2p6r5Y+IDWsOqhFZIv7y54Nae1rr8CtWPJRpCOQmS5GTR4jjdOolNsTSQPAiS03usyXl0ZqXRmvUPWYA==';
process.env.ACCOUNT_ID='someValue';

Wallaby will just pass the current process env variables to test workers.

@andrewconnell
Copy link
Author

Awesome... the workaround works for me for now... thanks.

@ArtemGovorov
Copy link
Member

The issue is fixed in core v1.0.279.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants