-
Notifications
You must be signed in to change notification settings - Fork 83
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
Conversation
e456c76
to
6f97b98
Compare
There was a problem hiding this 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try(Paths.get(v.path).getFileName().toString()).getOrElse(v.path) | |
Try(Paths.get(v.path).filename).getOrElse(v.path) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
4a26905
to
d03ed87
Compare
Relativize.htmlSite(root.toNIO) | ||
root.toRelative(PathIO.workingDirectory).toURI(true) |
There was a problem hiding this comment.
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:
93fb847
to
7ba0cbe
Compare
|""".stripMargin | ||
| """.stripMargin, { | ||
if (Properties.isWin) | ||
"""|error: dep-error.md:4:13: Error downloading org.scalameta:not-exists_2.13.5:2.3.4 |
There was a problem hiding this comment.
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:???) |
There was a problem hiding this comment.
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.
Fixes #511