up the blokcing tasks
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
Notify Smoke Test / Notifier Service Tests (push) Has been cancelled
Notify Smoke Test / Notification Smoke Test (push) Has been cancelled
Notify Smoke Test / Notify Unit Tests (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Export Center CI / export-ci (push) Has been cancelled
Manifest Integrity / Validate Schema Integrity (push) Has been cancelled
Manifest Integrity / Validate Contract Documents (push) Has been cancelled
Manifest Integrity / Validate Pack Fixtures (push) Has been cancelled
Manifest Integrity / Audit SHA256SUMS Files (push) Has been cancelled
Manifest Integrity / Verify Merkle Roots (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
Risk Bundle CI / risk-bundle-build (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Risk Bundle CI / risk-bundle-offline-kit (push) Has been cancelled
Risk Bundle CI / publish-checksums (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
devportal-offline / build-offline (push) Has been cancelled
Mirror Thin Bundle Sign & Verify / mirror-sign (push) Has been cancelled
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
Notify Smoke Test / Notifier Service Tests (push) Has been cancelled
Notify Smoke Test / Notification Smoke Test (push) Has been cancelled
Notify Smoke Test / Notify Unit Tests (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Export Center CI / export-ci (push) Has been cancelled
Manifest Integrity / Validate Schema Integrity (push) Has been cancelled
Manifest Integrity / Validate Contract Documents (push) Has been cancelled
Manifest Integrity / Validate Pack Fixtures (push) Has been cancelled
Manifest Integrity / Audit SHA256SUMS Files (push) Has been cancelled
Manifest Integrity / Verify Merkle Roots (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
Risk Bundle CI / risk-bundle-build (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Risk Bundle CI / risk-bundle-offline-kit (push) Has been cancelled
Risk Bundle CI / publish-checksums (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
devportal-offline / build-offline (push) Has been cancelled
Mirror Thin Bundle Sign & Verify / mirror-sign (push) Has been cancelled
This commit is contained in:
@@ -9,10 +9,10 @@ public sealed class DenoRuntimeTraceProbeTests
|
||||
public void ComputesMetadataAndHashFromNdjson()
|
||||
{
|
||||
const string ndjson =
|
||||
@"{\""type\"":\"\"deno.module.load\"",\""ts\"":\"\"2025-11-17T12:00:00Z\"",\""reason\"":\"\"dynamic-import\"",\""permissions\"":[\"\"fs\""],\""origin\"":\"\"https://deno.land\""}
|
||||
{\""type\"":\"\"deno.permission.use\"",\""ts\"":\"\"2025-11-17T12:00:01Z\"",\""permission\"":\"\"NET\""}
|
||||
{\""type\"":\"\"deno.npm.resolution\"",\""ts\"":\"\"2025-11-17T12:00:02Z\""}
|
||||
{\""type\"":\"\"deno.wasm.load\"",\""ts\"":\"\"2025-11-17T12:00:03Z\""}
|
||||
@"{""type"":""deno.module.load"",""ts"":""2025-11-17T12:00:00Z"",""reason"":""dynamic-import"",""permissions"":[""fs""],""origin"":""https://deno.land""}
|
||||
{""type"":""deno.permission.use"",""ts"":""2025-11-17T12:00:01Z"",""permission"":""NET""}
|
||||
{""type"":""deno.npm.resolution"",""ts"":""2025-11-17T12:00:02Z""}
|
||||
{""type"":""deno.wasm.load"",""ts"":""2025-11-17T12:00:03Z""}
|
||||
";
|
||||
|
||||
var bytes = Encoding.UTF8.GetBytes(ndjson);
|
||||
|
||||
@@ -82,7 +82,7 @@ public sealed class DenoRuntimeTraceRunnerTests
|
||||
{
|
||||
var stub = CreateStubDeno(root);
|
||||
var entry = Path.Combine(root, "main.ts");
|
||||
var fixture = Path.Combine(TestPaths.GetProjectRoot(), "TestFixtures/deno-runtime/simple/main.ts");
|
||||
var fixture = Path.Combine(TestPaths.ResolveProjectRoot(), "TestFixtures/deno-runtime/simple/main.ts");
|
||||
File.Copy(fixture, entry);
|
||||
|
||||
using var entryEnv = new EnvironmentVariableScope("STELLA_DENO_ENTRYPOINT", "main.ts");
|
||||
@@ -126,13 +126,15 @@ public sealed class DenoRuntimeTraceRunnerTests
|
||||
}
|
||||
else
|
||||
{
|
||||
var script = """#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cat > deno-runtime.ndjson <<'EOF'
|
||||
{"type":"deno.runtime.start","ts":"2025-01-01T00:00:00Z","module":{"normalized":".","path_sha256":"0"},"reason":"shim-start"}
|
||||
{"type":"deno.module.load","ts":"2025-01-01T00:00:01Z","module":{"normalized":"main.ts","path_sha256":"abc"},"reason":"static-import","permissions":[]}
|
||||
EOF
|
||||
""";
|
||||
var script =
|
||||
"""
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cat > deno-runtime.ndjson <<'EOF'
|
||||
{"type":"deno.runtime.start","ts":"2025-01-01T00:00:00Z","module":{"normalized":".","path_sha256":"0"},"reason":"shim-start"}
|
||||
{"type":"deno.module.load","ts":"2025-01-01T00:00:01Z","module":{"normalized":"main.ts","path_sha256":"abc"},"reason":"static-import","permissions":[]}
|
||||
EOF
|
||||
""";
|
||||
File.WriteAllText(path, script);
|
||||
try
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Text;
|
||||
using StellaOps.Scanner.Analyzers.Lang.Deno.Internal.Runtime;
|
||||
using StellaOps.Scanner.Analyzers.Lang.Tests.TestUtilities;
|
||||
|
||||
namespace StellaOps.Scanner.Analyzers.Lang.Deno.Tests.Deno;
|
||||
|
||||
@@ -42,8 +41,8 @@ public sealed class DenoRuntimeTraceSerializerTests
|
||||
|
||||
// Stable hash and NDJSON ordering
|
||||
const string expectedNdjson =
|
||||
@"{\""type\"":\"\"deno.module.load\"",\""ts\"":\"\"2025-11-17T12:00:00.123+00:00\"",\""module\"":{\""normalized\"":\"\"app/main.ts\"",\""path_sha256\"":\"\"abc123\""},\""reason\"":\"\"dynamic-import\"",\""permissions\"":[\"\"fs\"\", \""net\""],\""origin\"":\"\"https://deno.land/x/std@0.208.0/http/server.ts\""}
|
||||
{\""type\"":\"\"deno.permission.use\"",\""ts\"":\"\"2025-11-17T12:00:01.234+00:00\"",\""permission\"":\"\"ffi\"",\""module\"":{\""normalized\"":\"\"native/mod.ts\"",\""path_sha256\"":\"\"def456\""},\""details\"":\"\"Deno.dlopen\""}
|
||||
@"{""type"":""deno.module.load"",""ts"":""2025-11-17T12:00:00.123+00:00"",""module"":{""normalized"":""app/main.ts"",""path_sha256"":""abc123""},""reason"":""dynamic-import"",""permissions"":[""fs"",""net""],""origin"":""https://deno.land/x/std@0.208.0/http/server.ts""}
|
||||
{""type"":""deno.permission.use"",""ts"":""2025-11-17T12:00:01.234+00:00"",""permission"":""ffi"",""module"":{""normalized"":""native/mod.ts"",""path_sha256"":""def456""},""details"":""Deno.dlopen""}
|
||||
";
|
||||
|
||||
Assert.Equal(expectedNdjson.Replace("\r\n", "\n"), text.Replace("\r\n", "\n"));
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "cache-offline-fixture",
|
||||
"version": "1.0.0",
|
||||
"imports": {
|
||||
"std/": "https://deno.land/std@0.218.0/"
|
||||
}
|
||||
}
|
||||
10
src/Scanner/__Tests/StellaOps.Scanner.Analyzers.Lang.Deno.Tests/Fixtures/cache-offline/deno.lock
generated
Normal file
10
src/Scanner/__Tests/StellaOps.Scanner.Analyzers.Lang.Deno.Tests/Fixtures/cache-offline/deno.lock
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"version": "3",
|
||||
"packages": {},
|
||||
"redirects": {},
|
||||
"remote": {
|
||||
"https://deno.land/std@0.218.0/path/mod.ts": "a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890",
|
||||
"https://deno.land/std@0.218.0/path/posix.ts": "b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890ab",
|
||||
"https://deno.land/std@0.218.0/path/win32.ts": "c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890abcd"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import { join, dirname } from "std/path/mod.ts";
|
||||
|
||||
const configPath = join(Deno.cwd(), "config.json");
|
||||
console.log("Config directory:", dirname(configPath));
|
||||
@@ -0,0 +1,4 @@
|
||||
export class Config {
|
||||
readonly name = "LocalProject";
|
||||
readonly version = "1.0.0";
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
export function greet(name: string): string {
|
||||
return `Hello, ${name}!`;
|
||||
}
|
||||
|
||||
export function formatDate(date: Date): string {
|
||||
return date.toISOString();
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { greet } from "./lib/utils.ts";
|
||||
import { Config } from "./config.ts";
|
||||
|
||||
const config = new Config();
|
||||
console.log(greet(config.name));
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "npm-mixed-fixture",
|
||||
"version": "1.0.0",
|
||||
"imports": {
|
||||
"std/": "https://deno.land/std@0.218.0/",
|
||||
"lodash": "npm:lodash@4.17.21",
|
||||
"zod": "npm:zod@3.22.4"
|
||||
},
|
||||
"nodeModulesDir": true
|
||||
}
|
||||
23
src/Scanner/__Tests/StellaOps.Scanner.Analyzers.Lang.Deno.Tests/Fixtures/npm-mixed/deno.lock
generated
Normal file
23
src/Scanner/__Tests/StellaOps.Scanner.Analyzers.Lang.Deno.Tests/Fixtures/npm-mixed/deno.lock
generated
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"version": "3",
|
||||
"packages": {
|
||||
"specifiers": {
|
||||
"npm:lodash@4.17.21": "npm:lodash@4.17.21",
|
||||
"npm:zod@3.22.4": "npm:zod@3.22.4"
|
||||
},
|
||||
"npm": {
|
||||
"lodash@4.17.21": {
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||
"dependencies": {}
|
||||
},
|
||||
"zod@3.22.4": {
|
||||
"integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfHq7N5W6qFnIgJH90r3MFzPmWPlp6FV6A8pvQ==",
|
||||
"dependencies": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"redirects": {},
|
||||
"remote": {
|
||||
"https://deno.land/std@0.218.0/path/mod.ts": "a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import _ from "lodash";
|
||||
import { z } from "zod";
|
||||
import { join } from "std/path/mod.ts";
|
||||
|
||||
const UserSchema = z.object({
|
||||
name: z.string(),
|
||||
email: z.string().email(),
|
||||
});
|
||||
|
||||
const users = [
|
||||
{ name: "Alice", email: "alice@example.com" },
|
||||
{ name: "Bob", email: "bob@example.com" },
|
||||
];
|
||||
|
||||
const validUsers = users.filter((u) => {
|
||||
const result = UserSchema.safeParse(u);
|
||||
return result.success;
|
||||
});
|
||||
|
||||
console.log(_.map(validUsers, "name"));
|
||||
console.log(join("data", "users.json"));
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "remote-only-fixture",
|
||||
"version": "1.0.0",
|
||||
"imports": {
|
||||
"std/": "https://deno.land/std@0.218.0/",
|
||||
"oak": "https://deno.land/x/oak@v12.6.1/mod.ts"
|
||||
},
|
||||
"compilerOptions": {
|
||||
"strict": true
|
||||
}
|
||||
}
|
||||
12
src/Scanner/__Tests/StellaOps.Scanner.Analyzers.Lang.Deno.Tests/Fixtures/remote-only/deno.lock
generated
Normal file
12
src/Scanner/__Tests/StellaOps.Scanner.Analyzers.Lang.Deno.Tests/Fixtures/remote-only/deno.lock
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"version": "3",
|
||||
"packages": {},
|
||||
"redirects": {},
|
||||
"remote": {
|
||||
"https://deno.land/std@0.218.0/assert/assert.ts": "ba6c57f1fdd6f3ee8dd5da24b6f75fc34eb3d65721a47c1c31add2f8bf4e91f4",
|
||||
"https://deno.land/std@0.218.0/fmt/colors.ts": "d67e3cd9f472f5b4d77876b52e2e54f5bb0a5a4c3eb9f3fae9e3c5b3b1c93ff6",
|
||||
"https://deno.land/std@0.218.0/http/server.ts": "a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890",
|
||||
"https://deno.land/x/oak@v12.6.1/mod.ts": "fedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321",
|
||||
"https://deno.land/x/oak@v12.6.1/router.ts": "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Application } from "oak";
|
||||
import { assertEquals } from "std/assert/assert.ts";
|
||||
import { red, green } from "std/fmt/colors.ts";
|
||||
|
||||
const app = new Application();
|
||||
|
||||
app.use((ctx) => {
|
||||
ctx.response.body = green("Hello from Deno!");
|
||||
});
|
||||
|
||||
await app.listen({ port: 8000 });
|
||||
@@ -0,0 +1 @@
|
||||
global using StellaOps.Scanner.Analyzers.Lang.Deno.Tests.TestUtilities;
|
||||
Reference in New Issue
Block a user