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

Fix inconsistent line endings in tests #1288

Merged
merged 5 commits into from
Jun 17, 2024

Conversation

jamesfoster
Copy link
Contributor

No description provided.

@jamesfoster jamesfoster force-pushed the failing-tests-on-windows branch from e073fd4 to 275fa00 Compare June 10, 2024 21:07
@shocklateboy92
Copy link
Collaborator

@jamesfoster what exactly is this for? Could you clarify a little what you mean by "inconsistent line endings"?

@jamesfoster
Copy link
Contributor Author

#1240 (comment)

I explain in this comment

After a clean checkout of the repo on windows, several tests fail because of line ending mismatches.

@jamesfoster
Copy link
Contributor Author

Also notice these checks are failing. I turned on csharpier formatting on save but clearly missed a file somewhere. I'll reformat and update the branch with main later today

@jamesfoster
Copy link
Contributor Author

Apologies for the delay. I had a hectic weekend. Will get to this today.

@jamesfoster jamesfoster force-pushed the failing-tests-on-windows branch from 1c425f1 to 56056b6 Compare June 17, 2024 15:42
@jamesfoster jamesfoster force-pushed the failing-tests-on-windows branch from 56056b6 to e69679c Compare June 17, 2024 15:48
@jamesfoster
Copy link
Contributor Author

jamesfoster commented Jun 17, 2024

Rebased onto main bc331cd

@jamesfoster
Copy link
Contributor Author

@shocklateboy92 @belav There is still one test that fails for me locally.

public async Task Should_Return_Error_When_No_DirectoryOrFile_And_Not_Piping_StdIn()
{
if (CannotRunTestWithRedirectedInput())
{
return;
}
var result = await new CsharpierProcess().ExecuteAsync();
result.ExitCode.Should().Be(1);
result
.ErrorOutput.Should()
.Contain("directoryOrFile is required when not piping stdin to CSharpier");
}

The exit code is 0 for me but the test asserts it should be 1. Any ideas?

Copy link
Collaborator

@shocklateboy92 shocklateboy92 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for your contribution.

@shocklateboy92 shocklateboy92 merged commit 75a582b into belav:main Jun 17, 2024
3 checks passed
@jamesfoster
Copy link
Contributor Author

@belav #1288 (comment)
Can I get your thoughts on why Should_Return_Error_When_No_DirectoryOrFile_And_Not_Piping_StdIn might be failing for me?

@shocklateboy92
Copy link
Collaborator

Hey @jamesfoster, sorry I rudely completed the PR to get it off my queue 😛

As for your issue, you can run the test locally with a debugger breakpoint and see if it reaches this validator:

if (!Console.IsInputRedirected && cmd.Children.Contains("--pipe-multiple-files"))

@jamesfoster jamesfoster deleted the failing-tests-on-windows branch June 19, 2024 12:33
@jamesfoster
Copy link
Contributor Author

Thanks @shocklateboy92 I'll look into it

@pisolofin
Copy link

I have the same issue.
In Debug of Test I can reach only, after The breakpoint will not currently be hit. No symbols have been loaded for this document.

public async Task<ProcessResult> ExecuteAsync()

The result is:
image

Can @jamesfoster halp me?

Thanks.

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.

5 participants