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

Add tests on Windows CI #512

Merged
merged 1 commit into from
Jun 9, 2021
Merged

Add tests on Windows CI #512

merged 1 commit into from
Jun 9, 2021

Conversation

tgodzik
Copy link
Contributor

@tgodzik tgodzik commented Jun 7, 2021

Fixes #511

@tgodzik tgodzik force-pushed the add-windows branch 7 times, most recently from e456c76 to 6f97b98 Compare June 7, 2021 16:06
Copy link
Member

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

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

Thank you for looking into this! Just a few minor nit comments, but LGTM 👍 it's fantastic to finally have Windows CI. It's such a huge upgrade to have GitHub Actions over Travis (which is what this repo used originally)


trait CliEnrichments {
implicit class XtensionInputMdoc(input: Input) {
def filename: String =
input match {
case s: Input.Slice => s.input.filename
case f: Input.File => f.path.filename
case v: Input.VirtualFile =>
Try(Paths.get(v.path).getFileName().toString()).getOrElse(v.path)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Try(Paths.get(v.path).getFileName().toString()).getOrElse(v.path)
Try(Paths.get(v.path).filename).getOrElse(v.path)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to Try(AbsolutePath(Paths.get(v.path)).filename).getOrElse(v.path), since the extension method exists on AbsolutePath not Path. Alternative would be to add an extension for Path, but I don't think that is neccessary.


trait CliEnrichments {
implicit class XtensionInputMdoc(input: Input) {
def filename: String =
input match {
case s: Input.Slice => s.input.filename
case f: Input.File => f.path.filename
case v: Input.VirtualFile =>
Try(Paths.get(v.path).getFileName().toString()).getOrElse(v.path)
Copy link
Member

Choose a reason for hiding this comment

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

What syntax is v.path using that makes Paths.get fail? Is it possible to change the syntax of v.path so that this try/catch doesn't always fail on Windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

v.path was printing D:/ which is an invalid windows path from what I remember. But I was doing a lot of changes, so not sure exactly right now. I will investigate the failure a bit further today.

@tgodzik tgodzik force-pushed the add-windows branch 4 times, most recently from 4a26905 to d03ed87 Compare June 9, 2021 11:51
Relativize.htmlSite(root.toNIO)
root.toRelative(PathIO.workingDirectory).toURI(true)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

root might be on C: while working dir on D:

@tgodzik tgodzik force-pushed the add-windows branch 6 times, most recently from 93fb847 to 7ba0cbe Compare June 9, 2021 14:15
@tgodzik tgodzik marked this pull request as ready for review June 9, 2021 14:28
|""".stripMargin
| """.stripMargin, {
if (Properties.isWin)
"""|error: dep-error.md:4:13: Error downloading org.scalameta:not-exists_2.13.5:2.3.4
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had a lot of issues with this test, seems that on each version/platform the order is different, but it should fine now. We might split it into different tests in the future to avoid issues.

|<TAB>at scala.Predef$.$qmark$qmark$qmark(Predef.scala:345)
""".stripMargin.replace("<TAB>", tab)
)
| at scala.Predef$.$qmark$qmark$qmark(Predef.scala:???)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems this was a TAB in each version. I also changed Predef lines to ??? since it seems this changes very often.

@tgodzik tgodzik merged commit b9437b7 into scalameta:main Jun 9, 2021
@tgodzik tgodzik deleted the add-windows branch June 9, 2021 18:22
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.

Windows… doesn't work reliably
2 participants