From 074da23b948e10b9fa1cba6dd6f98299fec62178 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Tue, 2 Mar 2021 15:55:46 +0900 Subject: [PATCH 1/5] chore(path): disable some failed test related to https://github.com/denoland/deno/pull/9276 --- path/from_file_url_test.ts | 3 ++- path/to_file_url_test.ts | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/path/from_file_url_test.ts b/path/from_file_url_test.ts index 61a45a89bec0..3c380f399c50 100644 --- a/path/from_file_url_test.ts +++ b/path/from_file_url_test.ts @@ -31,7 +31,8 @@ Deno.test("[path] fromFileUrl (win32)", function () { assertEquals(win32.fromFileUrl("file:///home/foo"), "\\home\\foo"); assertEquals(win32.fromFileUrl("file:///home/foo%20bar"), "\\home\\foo bar"); assertEquals(win32.fromFileUrl("file:///%"), "\\%"); - assertEquals(win32.fromFileUrl("file://localhost/foo"), "\\\\localhost\\foo"); + // TODO(kt3k): Update and re-enable this when 1.8 is released + // assertEquals(win32.fromFileUrl("file://localhost/foo"), "\\\\localhost\\foo"); assertEquals(win32.fromFileUrl("file:///C:"), "C:\\"); assertEquals(win32.fromFileUrl("file:///C:/"), "C:\\"); // Drop the hostname if a drive letter is parsed. diff --git a/path/to_file_url_test.ts b/path/to_file_url_test.ts index c4ee1a2368e2..04110b6d2a7d 100644 --- a/path/to_file_url_test.ts +++ b/path/to_file_url_test.ts @@ -4,7 +4,8 @@ import { assertEquals, assertThrows } from "../testing/asserts.ts"; Deno.test("[path] toFileUrl", function () { assertEquals(posix.toFileUrl("/home/foo").href, "file:///home/foo"); - assertEquals(posix.toFileUrl("/home/ ").href, "file:///home/%20"); + // TODO(kt3k): Update and re-enable this when 1.8 is released + // assertEquals(posix.toFileUrl("/home/ ").href, "file:///home/%20"); assertEquals(posix.toFileUrl("/home/%20").href, "file:///home/%2520"); assertEquals(posix.toFileUrl("/home\\foo").href, "file:///home%5Cfoo"); assertThrows( @@ -17,17 +18,20 @@ Deno.test("[path] toFileUrl", function () { TypeError, "Must be an absolute path.", ); + /* TODO(kt3k): Update and re-enable this when 1.8 is released assertEquals( posix.toFileUrl("//localhost/home/foo").href, "file:////localhost/home/foo", ); assertEquals(posix.toFileUrl("//localhost/").href, "file:////localhost/"); assertEquals(posix.toFileUrl("//:/home/foo").href, "file:////:/home/foo"); + */ }); Deno.test("[path] toFileUrl (win32)", function () { assertEquals(win32.toFileUrl("/home/foo").href, "file:///home/foo"); - assertEquals(win32.toFileUrl("/home/ ").href, "file:///home/%20"); + // TODO(kt3k): Update and re-enable this when 1.8 is released + // assertEquals(win32.toFileUrl("/home/ ").href, "file:///home/%20"); assertEquals(win32.toFileUrl("/home/%20").href, "file:///home/%2520"); assertEquals(win32.toFileUrl("/home\\foo").href, "file:///home/foo"); assertThrows( @@ -36,11 +40,13 @@ Deno.test("[path] toFileUrl (win32)", function () { "Must be an absolute path.", ); assertEquals(win32.toFileUrl("C:/").href, "file:///C:/"); + /* TODO(kt3k): Update and re-enable this when 1.8 is released assertEquals( win32.toFileUrl("//localhost/home/foo").href, "file://localhost/home/foo", ); assertEquals(win32.toFileUrl("//localhost/").href, "file:////localhost/"); + */ assertThrows( () => win32.toFileUrl("//:/home/foo").href, TypeError, From 39438b6660d0a952660f7690bae9c5201344cdf1 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Tue, 2 Mar 2021 17:17:46 +0900 Subject: [PATCH 2/5] chore(build): disable codecov status --- .github/codecov.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/codecov.yml b/.github/codecov.yml index 060eb6073533..628131ff4402 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -1,3 +1,7 @@ comment: false codecov: require_ci_to_pass: true +coverage: + status: + project: off + patch: off From 607ffd1c296a63f0dc8b9a9318a5feb4967520b8 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Tue, 2 Mar 2021 19:09:51 +0900 Subject: [PATCH 3/5] chore(codecov): use informational mode --- .github/codecov.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/codecov.yml b/.github/codecov.yml index 628131ff4402..de3e4b49402b 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -3,5 +3,6 @@ codecov: require_ci_to_pass: true coverage: status: - project: off - patch: off + project: + default: + informational: true From d7d174131e67da86a4a37819a6ae3bbbb5a749e0 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Wed, 3 Mar 2021 00:24:06 +0900 Subject: [PATCH 4/5] fix(path): fix tests for canary, skip for stable --- path/from_file_url_test.ts | 8 ++++-- path/to_file_url_test.ts | 50 +++++++++++++++++++++++--------------- 2 files changed, 37 insertions(+), 21 deletions(-) diff --git a/path/from_file_url_test.ts b/path/from_file_url_test.ts index 3c380f399c50..aa230dcb66fa 100644 --- a/path/from_file_url_test.ts +++ b/path/from_file_url_test.ts @@ -25,14 +25,18 @@ Deno.test("[path] fromFileUrl", function () { ); }); +const isCanary = /\d\.\d\.\d\+[0-9a-f]{7}/.test(Deno.version.deno); + Deno.test("[path] fromFileUrl (win32)", function () { assertEquals(win32.fromFileUrl(new URL("file:///home/foo")), "\\home\\foo"); assertEquals(win32.fromFileUrl("file:///"), "\\"); assertEquals(win32.fromFileUrl("file:///home/foo"), "\\home\\foo"); assertEquals(win32.fromFileUrl("file:///home/foo%20bar"), "\\home\\foo bar"); assertEquals(win32.fromFileUrl("file:///%"), "\\%"); - // TODO(kt3k): Update and re-enable this when 1.8 is released - // assertEquals(win32.fromFileUrl("file://localhost/foo"), "\\\\localhost\\foo"); + // TODO(kt3k): Enable this assertion again in stable deno when 1.8.0 is landed. + if (isCanary) { + assertEquals(win32.fromFileUrl("file://localhost/foo"), "\\foo"); + } assertEquals(win32.fromFileUrl("file:///C:"), "C:\\"); assertEquals(win32.fromFileUrl("file:///C:/"), "C:\\"); // Drop the hostname if a drive letter is parsed. diff --git a/path/to_file_url_test.ts b/path/to_file_url_test.ts index 04110b6d2a7d..09ce628035d6 100644 --- a/path/to_file_url_test.ts +++ b/path/to_file_url_test.ts @@ -2,10 +2,14 @@ import { posix, win32 } from "./mod.ts"; import { assertEquals, assertThrows } from "../testing/asserts.ts"; +const isCanary = /\d\.\d\.\d\+[0-9a-f]{7}/.test(Deno.version.deno); + Deno.test("[path] toFileUrl", function () { assertEquals(posix.toFileUrl("/home/foo").href, "file:///home/foo"); - // TODO(kt3k): Update and re-enable this when 1.8 is released - // assertEquals(posix.toFileUrl("/home/ ").href, "file:///home/%20"); + // TODO(kt3k): Enable this assertion again in stable deno when 1.8.0 is landed. + if (isCanary) { + assertEquals(posix.toFileUrl("/home/ ").href, "file:///home/"); + } assertEquals(posix.toFileUrl("/home/%20").href, "file:///home/%2520"); assertEquals(posix.toFileUrl("/home\\foo").href, "file:///home%5Cfoo"); assertThrows( @@ -18,20 +22,23 @@ Deno.test("[path] toFileUrl", function () { TypeError, "Must be an absolute path.", ); - /* TODO(kt3k): Update and re-enable this when 1.8 is released - assertEquals( - posix.toFileUrl("//localhost/home/foo").href, - "file:////localhost/home/foo", - ); - assertEquals(posix.toFileUrl("//localhost/").href, "file:////localhost/"); - assertEquals(posix.toFileUrl("//:/home/foo").href, "file:////:/home/foo"); - */ + // TODO(kt3k): Enable this assertion again in stable deno when 1.8.0 is landed. + if (isCanary) { + assertEquals( + posix.toFileUrl("//localhost/home/foo").href, + "file:///localhost/home/foo", + ); + assertEquals(posix.toFileUrl("//localhost/").href, "file:///localhost/"); + assertEquals(posix.toFileUrl("//:/home/foo").href, "file:///:/home/foo"); + } }); Deno.test("[path] toFileUrl (win32)", function () { assertEquals(win32.toFileUrl("/home/foo").href, "file:///home/foo"); - // TODO(kt3k): Update and re-enable this when 1.8 is released - // assertEquals(win32.toFileUrl("/home/ ").href, "file:///home/%20"); + // TODO(kt3k): Enable this assertion again in stable deno when 1.8.0 is landed. + if (isCanary) { + assertEquals(win32.toFileUrl("/home/ ").href, "file:///home/"); + } assertEquals(win32.toFileUrl("/home/%20").href, "file:///home/%2520"); assertEquals(win32.toFileUrl("/home\\foo").href, "file:///home/foo"); assertThrows( @@ -40,13 +47,18 @@ Deno.test("[path] toFileUrl (win32)", function () { "Must be an absolute path.", ); assertEquals(win32.toFileUrl("C:/").href, "file:///C:/"); - /* TODO(kt3k): Update and re-enable this when 1.8 is released - assertEquals( - win32.toFileUrl("//localhost/home/foo").href, - "file://localhost/home/foo", - ); - assertEquals(win32.toFileUrl("//localhost/").href, "file:////localhost/"); - */ + // TODO(kt3k): Enable this assertion again in stable deno when 1.8.0 is landed. + if (isCanary) { + assertThrows( + () => assertEquals( + win32.toFileUrl("//localhost/home/foo").href, + "file://localhost/home/foo", + ), + TypeError, + "Invalid hostname.", + ) + assertEquals(win32.toFileUrl("//localhost/").href, "file:///localhost/"); + } assertThrows( () => win32.toFileUrl("//:/home/foo").href, TypeError, From d7ca3d81d965bb1f75af29bfadf3cf3760c1cd44 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Wed, 3 Mar 2021 00:26:19 +0900 Subject: [PATCH 5/5] fmt --- path/to_file_url_test.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/path/to_file_url_test.ts b/path/to_file_url_test.ts index 09ce628035d6..9d2287a24436 100644 --- a/path/to_file_url_test.ts +++ b/path/to_file_url_test.ts @@ -50,13 +50,14 @@ Deno.test("[path] toFileUrl (win32)", function () { // TODO(kt3k): Enable this assertion again in stable deno when 1.8.0 is landed. if (isCanary) { assertThrows( - () => assertEquals( - win32.toFileUrl("//localhost/home/foo").href, - "file://localhost/home/foo", - ), + () => + assertEquals( + win32.toFileUrl("//localhost/home/foo").href, + "file://localhost/home/foo", + ), TypeError, "Invalid hostname.", - ) + ); assertEquals(win32.toFileUrl("//localhost/").href, "file:///localhost/"); } assertThrows(