Skip to content

Make an attempt to get environment information for non-Windows platforms#1105

Merged
nohwnd merged 2 commits intopester:masterfrom
JamesWTruher:NonWindowsReport
Sep 30, 2018
Merged

Make an attempt to get environment information for non-Windows platforms#1105
nohwnd merged 2 commits intopester:masterfrom
JamesWTruher:NonWindowsReport

Conversation

@JamesWTruher
Copy link
Copy Markdown
Contributor

I'm definitely missing environment information when running Pester in our CI on Non-Windows platforms. I would love if the logs had that information. This is an attempt at providing that information with tools that will probably be there. I'm using uname and id to provide that info. If those tools aren't there, we won't be any worse off, but if they are there, then we can provide the test environment pretty well.

@JamesWTruher
Copy link
Copy Markdown
Contributor Author

JamesWTruher commented Sep 27, 2018

@dlwyatt @it-praktyk @nohwnd - Could you take a look to see if I've taken an appropriate approach? Thanks!

@nohwnd
Copy link
Copy Markdown
Member

nohwnd commented Sep 29, 2018

@JamesWTruher tested it on macOS and the only thing I found that the username is not just username but a whole user info. To print just username it should be id -un, which worked on macOS, but I haven't tested it on linux.

Name                           Value
----                           -----
cwd                            /Users/nohwnd/projects/pester_main
user-domain
nunit-version                  2.5.8.0
clr-version                    Unknown
user                           uid=501(nohwnd) gid=20(staff) groups=20(staff...
platform                       Darwin
os-version                     17.7.0
machine-name                   nmbp

@it-praktyk
Copy link
Copy Markdown
Contributor

Tested on Linux.

id returns

uid=1000(<USER_NAME>) gid=1000(<USER_NAME>) groups=1000(<USER_NAME>),10(wheel),18(dialout),970(vboxusers) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
``

Comment thread Functions/TestResults.ps1 Outdated
@it-praktyk
Copy link
Copy Markdown
Contributor

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<test-results xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="nunit_schema_2.5.xsd" name="Pester" total="982" errors="0" failures="5" not-run="0" inconclusive="0" ignored="0" skipped="0" invalid="0" date="2018-09-30" time="11:07:18">
  <environment machine-name="<COMPUTERNAME>>" os-version="4.18.9-200.fc28.x86_64" nunit-version="2.5.8.0" user="<USER_NAME>" cwd="/home/<USER_NAME>/Scripts/Pester" platform="Linux" user-domain="" clr-version="Unknown" />

OUTPUT_PARTIALLY OMITTED

@nohwnd
Copy link
Copy Markdown
Member

nohwnd commented Sep 30, 2018

@it-praktyk what does that mean? That it works? Or that it does not work? More context please.

(btw I added the -un parameter some hour ago.)

@it-praktyk
Copy link
Copy Markdown
Contributor

it-praktyk commented Sep 30, 2018 via email

@nohwnd nohwnd merged commit 5bfd055 into pester:master Sep 30, 2018
@JamesWTruher
Copy link
Copy Markdown
Contributor Author

I was wondering about id vs id -un. I chose id because I thought more info would be better, but if it's really just about the username, then id -un matches intent better.
Thanks for the quick look!
@it-praktyk @nohwnd

@nohwnd
Copy link
Copy Markdown
Member

nohwnd commented Oct 3, 2018

It’s out.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants