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

Make sure all tests fail even running under admin privileges. #85

Merged
merged 2 commits into from
Jan 22, 2016

Conversation

michaelcfanning
Copy link
Member

Resolves #81. @lgolding

Larry, note in the meantime that you can run tests as non-admin to verify. This change also adds explicit platform property to build step.

michaelcfanning added a commit that referenced this pull request Jan 22, 2016
Make sure all tests fail even running under admin privileges.
@michaelcfanning michaelcfanning merged commit 8c01f99 into master Jan 22, 2016
@@ -308,10 +308,10 @@ public void IOExceptionRaisedCreatingSarifLog()
[Fact]
public void UnauthorizedAccessExceptionCreatingSarifLog()
{
string path = Environment.GetFolderPath(Environment.SpecialFolder.Windows);
string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
path = Path.Combine(path, Guid.NewGuid().ToString());
Copy link

Choose a reason for hiding this comment

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

Why does this work? I'd've expected that an admin could create a file anywhere.

Copy link

Choose a reason for hiding this comment

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

Oh, I see. I had to look at the whole file to understand that the failure happens when you try to persist to a file that already exists. And the change to ApplicationData is just because that's a better place than littering Windows.

@ghost
Copy link

ghost commented Jan 22, 2016

👍

@ghost ghost mentioned this pull request Jan 22, 2016
@michaelcfanning michaelcfanning deleted the unauth-test branch April 7, 2016 00:34
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

1 participant