Skip to content

Commit

Permalink
Ignore test file starting with _ like in parallel testing when not …
Browse files Browse the repository at this point in the history
…specific explicitly
  • Loading branch information
cderv committed Nov 14, 2023
1 parent 981f87f commit a00b573
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/smoke/smoke-all.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
import { readYaml, readYamlFromMarkdown } from "../../src/core/yaml.ts";
import { outputForInput } from "../utils.ts";
import { jupyterNotebookToMarkdown } from "../../src/command/convert/jupyter.ts";
import { dirname, join, relative } from "path/mod.ts";
import { basename, dirname, join, relative } from "path/mod.ts";
import { existsSync, WalkEntry } from "fs/mod.ts";

async function fullInit() {
Expand Down Expand Up @@ -162,7 +162,8 @@ await initYamlIntelligenceResourcesFromFilesystem();
// be silently ignored.)
const files: WalkEntry[] = [];
if (Deno.args.length === 0) {
files.push(...expandGlobSync("docs/smoke-all/**/*.{md,qmd,ipynb}"));
// ignore file starting with `_`
files.push(...[...expandGlobSync("docs/smoke-all/**/*.{md,qmd,ipynb}")].filter((entry) => /^[^_]/.test(basename(entry.path))));
} else {
for (const arg of Deno.args) {
files.push(...expandGlobSync(arg));
Expand All @@ -171,7 +172,7 @@ if (Deno.args.length === 0) {

for (const { path: fileName } of files) {
const input = relative(Deno.cwd(), fileName);

const metadata = input.endsWith("md") // qmd or md
? readYamlFromMarkdown(Deno.readTextFileSync(input))
: readYamlFromMarkdown(await jupyterNotebookToMarkdown(input, false));
Expand Down

0 comments on commit a00b573

Please sign in to comment.