summaryrefslogtreecommitdiff
path: root/tests/wpt/runner/utils.ts
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2024-10-03 18:31:36 +0530
committerGitHub <noreply@github.com>2024-10-03 13:01:36 +0000
commit54467015e0017a7a5fe9dd56eb21458325e2f3e9 (patch)
tree5392e378815dc56e0b5a0c2279c23398ac894dd1 /tests/wpt/runner/utils.ts
parentda7edf1c0c92dc8b0b746b015da911d5820c64ba (diff)
chore: show expectation diff for wpt tests (#26014)
Closes https://github.com/denoland/deno/issues/26012 ``` ======================================== failures: "/WebCryptoAPI/wrapKey_unwrapKey/wrapKey_unwrapKey.https.any.html - Can wrap and unwrap X25519 private key keys as non-extractable using pkcs8 and AES-CTR" final result: failed. 1 passed; 1 failed; 0 expected failure; total 2 (15646ms) diff --git a/Users/divy/gh/deno/tests/wpt/runner/expectation.json b/var/folders/ll/ltqsx4nx72v5_r7rlsl36pgm0000gn/T/375d79f1257b05cd index fb2063935..4449c5d15 100644 --- a/Users/divy/gh/deno/tests/wpt/runner/expectation.json +++ b/var/folders/ll/ltqsx4nx72v5_r7rlsl36pgm0000gn/T/375d79f1257b05cd @@ -1531,6 +1531,7 @@ }, "wrapKey_unwrapKey": { "wrapKey_unwrapKey.https.any.html": [ + "Can wrap and unwrap X25519 private key keys as non-extractable using pkcs8 and AES-CTR", "Can wrap and unwrap X25519 private key keys as non-extractable using pkcs8 and AES-CBC", "Can wrap and unwrap X25519 private key keys as non-extractable using pkcs8 and AES-GCM", "Can wrap and unwrap X25519 private key keys as non-extractable using pkcs8 and AES-KW", ```
Diffstat (limited to 'tests/wpt/runner/utils.ts')
-rw-r--r--tests/wpt/runner/utils.ts21
1 files changed, 18 insertions, 3 deletions
diff --git a/tests/wpt/runner/utils.ts b/tests/wpt/runner/utils.ts
index 1674419cd..140c388ec 100644
--- a/tests/wpt/runner/utils.ts
+++ b/tests/wpt/runner/utils.ts
@@ -76,7 +76,10 @@ export function getManifest(): Manifest {
/// WPT TEST EXPECTATIONS
-const EXPECTATION_PATH = join(ROOT_PATH, "./tests/wpt/runner/expectation.json");
+export const EXPECTATION_PATH = join(
+ ROOT_PATH,
+ "./tests/wpt/runner/expectation.json",
+);
export interface Expectation {
[key: string]: Expectation | boolean | string[] | { ignore: boolean };
@@ -87,9 +90,12 @@ export function getExpectation(): Expectation {
return JSON.parse(expectationText);
}
-export function saveExpectation(expectation: Expectation) {
+export function saveExpectation(
+ expectation: Expectation,
+ path: string = EXPECTATION_PATH,
+) {
Deno.writeTextFileSync(
- EXPECTATION_PATH,
+ path,
JSON.stringify(expectation, undefined, " ") + "\n",
);
}
@@ -134,6 +140,15 @@ export function runPy<T extends Omit<Deno.CommandOptions, "cwd">>(
}).spawn();
}
+export async function runGitDiff(args: string[]): string {
+ await new Deno.Command("git", {
+ args: ["diff", ...args],
+ stdout: "inherit",
+ stderr: "inherit",
+ cwd: ROOT_PATH,
+ }).output();
+}
+
export async function checkPy3Available() {
const { success, stdout } = await runPy(["--version"], {
stdout: "piped",