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

Expand environment variables when loading the noxfile from provided path #171

Merged
merged 2 commits into from
Feb 26, 2019

Conversation

s0undt3ch
Copy link
Contributor

Our CI setup uploads the repo to the system's temporary directory, which on Linux is known(or commonly enough /tmp) but on windows, %TEMP% is used:

❯ bundle exec kitchen verify py3-windows-2012r2
-----> Starting Kitchen (v1.23.5)
-----> Verifying <py3-windows-2012r2>...
       [Nox] Verify on instance py3-windows-2012r2 with state={:username=>"administrator", :auto_security_group_id=>"sg-0cf1cc52c2d0e5d24", :server_id=>"i-0f2b90b1cfedb970e", :hostname=>"10.27.2.213", :password=>"uDU9*;ZH(j", :last_action=
>"verify", :last_error=>nil}
       Running Command: nox -f %TEMP%\kitchen/testing/noxfile.py -e "runtests-3(coverage=True)" -- --output-columns=120 --sysinfo --xml=%TEMP%\kitchen/testing/artifacts/xml-unittests-output --names-file=%TEMP%\kitchen\testing\tests\whiteli
st.txt --transport=zeromq -v --run-destructive --ssh-tests    -n tests\unit 2>&1
       nox : Noxfile C:\Users\Administrator\Documents\%TEMP%\kitchen\testing\noxfile.py not found.
       At line:1 char:1
       + nox -f %TEMP%\kitchen/testing/noxfile.py -e "runtests-3(coverage=True)" -- --out ...
       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           + CategoryInfo          : NotSpecified: (Noxfile C:\User...e.py not found.:String) [], RemoteException
           + FullyQualifiedErrorId : NativeCommandError
        
       Verify command failed :: WinRM exited (2) for command: [nox -f %TEMP%\kitchen/testing/noxfile.py -e "runtests-3(coverage=True)" -- --output-columns=120 --sysinfo --xml=%TEMP%\kitchen/testing/artifacts/xml-unittests-output --names-fi
le=%TEMP%\kitchen\testing\tests\whitelist.txt --transport=zeromq -v --run-destructive --ssh-tests    -n tests\unit 2>&1]                                                                                                                      
       Copying %TEMP%\kitchen/testing/artifacts to /home/vampas/projects/SaltStack/salt/features/nox-2017.7/
       Copying c:/salt/var/log/salt/minion to artifacts/logs/minion
>>>>>> Failed to copy c:/salt/var/log/salt/minion to artifacts/logs/minion :: ${e}
       Finished verifying <py3-windows-2012r2> (0m14.00s).
-----> Kitchen is finished. (0m16.95s)

This PR processes the passed noxfile through os.path.expandvars to accommodate the above scenario.

Copy link
Collaborator

@dhermes dhermes left a comment

Choose a reason for hiding this comment

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

LGTM, I'll leave it to @theacodes to decide about the coverage

@theacodes
Copy link
Collaborator

Thanks for writing this @s0undt3ch and thanks for reviewing, @dhermes. :)

@theacodes theacodes merged commit 04e9e7a into wntrblm:master Feb 26, 2019
@s0undt3ch
Copy link
Contributor Author

Anytime!

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

Successfully merging this pull request may close these issues.

None yet

3 participants