Skip to content

Commit 92fc1ce

Browse files
aspeddrocknitt
authored andcommitted
skip windows
1 parent 7616471 commit 92fc1ce

File tree

6 files changed

+2667
-2662
lines changed

6 files changed

+2667
-2662
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ jobs:
9393
# Run the slower tasks on the fastest runner only
9494
build_playground: true
9595
benchmarks: true
96-
# docstring_tests: true
9796
- os: buildjet-2vcpu-ubuntu-2204-arm # ARM
9897
ocaml_compiler: ocaml-variants.5.2.1+options,ocaml-option-static
9998
upload_binaries: true
@@ -313,10 +312,6 @@ jobs:
313312
- name: Run tests
314313
run: node scripts/test.js -all
315314

316-
- name: Docstrings tests
317-
# if: matrix.docstring_tests
318-
run: node scripts/test.js -docstrings
319-
320315
- name: Check for diffs in tests folder
321316
run: git diff --ignore-cr-at-eol --exit-code tests
322317

scripts/test.js

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ if (process.argv.includes("-docstrings")) {
3434
runtimeDocstrings = true;
3535
}
3636

37-
// -all dont include runtimeDocstrings
3837
if (process.argv.includes("-all")) {
3938
ounitTest = true;
4039
mochaTest = true;
4140
bsbTest = true;
4241
formatTest = true;
42+
runtimeDocstrings = true;
4343
}
4444

4545
async function runTests() {
@@ -128,27 +128,37 @@ async function runTests() {
128128
}
129129

130130
if (runtimeDocstrings) {
131-
// if (process.platform === "win32") {
132-
// console.log(`Skipping docstrings tests on ${process.platform}`);
133-
// } else {
134-
console.log("Running runtime docstrings tests");
135-
cp.execSync(`${rescript_exe} build`, {
136-
cwd: path.join(__dirname, "..", "tests/docstrings_examples"),
137-
stdio: [0, 1, 2],
138-
});
131+
if (process.platform === "win32") {
132+
console.log(`Skipping docstrings tests on ${process.platform}`);
133+
} else {
134+
console.log("Running runtime docstrings tests");
135+
cp.execSync(`${rescript_exe} build`, {
136+
cwd: path.join(__dirname, "..", "tests/docstrings_examples"),
137+
stdio: [0, 1, 2],
138+
});
139139

140-
console.log("Formatting mocha_full_test.res")
141-
cp.execSync(`${path.resolve("./cli/rescript")} format ${path.join("tests", "docstrings_examples", "mocha_full_test.res")}`, {
142-
cwd: path.join(__dirname, ".."),
143-
stdio: [0, 1, 2],
144-
})
140+
cp.execSync(`node ${path.join("tests", "docstrings_examples", "DocTest.res.mjs")}`, {
141+
cwd: path.join(__dirname, ".."),
142+
stdio: [0, 1, 2],
143+
})
145144

146-
console.log("Run mocha test")
147-
cp.execSync(`npx mocha ${path.join("tests", "docstrings_examples", "mocha_full_test.res.mjs")}`, {
148-
cwd: path.join(__dirname, ".."),
149-
stdio: [0, 1, 2],
150-
});
151-
// }
145+
cp.execSync(`${rescript_exe} build`, {
146+
cwd: path.join(__dirname, "..", "tests/docstrings_examples"),
147+
stdio: [0, 1, 2],
148+
});
149+
150+
console.log("Formatting generated_mocha_test.res")
151+
cp.execSync(`./cli/rescript format ${path.join("tests", "docstrings_examples", "generated_mocha_test.res")}`, {
152+
cwd: path.join(__dirname, ".."),
153+
stdio: [0, 1, 2],
154+
})
155+
156+
console.log("Run mocha test")
157+
cp.execSync(`npx mocha ${path.join("tests", "docstrings_examples", "generated_mocha_test.res.mjs")}`, {
158+
cwd: path.join(__dirname, ".."),
159+
stdio: [0, 1, 2],
160+
});
161+
}
152162
}
153163
}
154164

tests/docstrings_examples/DocTest.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ let main = async () => {
182182
->Array.join("\n\n")
183183

184184
let dirname = url->URL.fileURLToPath->Path.dirname
185-
let filepath = Path.join([dirname, "mocha_full_test.res"])
185+
let filepath = Path.join([dirname, "generated_mocha_test.res"])
186186
let fileContent = `open Mocha
187187
@@warning("-32-34-60-37-109-3-44")
188188

tests/docstrings_examples/DocTest.res.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ async function main() {
224224
}
225225
}).join("\n\n");
226226
let dirname = Path.dirname(Url.fileURLToPath(import.meta.url));
227-
let filepath = Path.join(dirname, "mocha_full_test.res");
227+
let filepath = Path.join(dirname, "generated_mocha_test.res");
228228
let fileContent = "open Mocha\n@@warning(\"-32-34-60-37-109-3-44\")\n\n" + testsContent;
229229
return await Promises.writeFile(filepath, fileContent);
230230
}

0 commit comments

Comments
 (0)