Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up tests #1249

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ jobs:
uses: coactions/setup-xvfb@v1
with:
run: yarn test
env:
OPAMSWITCH: ${{ github.workspace }}

- name: Publish extension to VSCode Marketplace
if: success() && runner.os == 'Linux' && startsWith(github.ref, 'refs/tags')
Expand Down
4 changes: 2 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ _build/
_opam/

# esy
test/fixtures/sample-esy/_esy/
test/fixtures/sample-esy/esy.lock/
tests/fixtures/sample-esy/_esy/
tests/fixtures/sample-esy/esy.lock/

# Normal npm stuff
node_modules/
Expand Down
2 changes: 1 addition & 1 deletion dune
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(dirs :standard \ node_modules astexplorer)
(dirs :standard \ astexplorer node_modules tests)
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"astexplorer"
],
"scripts": {
"test:esy": "node ./test/runEsyTests.js",
"test:opam": "node ./test/runOpamTests.js",
"test:problems": "node ./test/runProblemMatcherTests.js",
"test": "npm-run-all -s test:opam test:problems",
"test:basic": "node ./tests/runBasicTests.js",
"test:esy": "node ./tests/runEsyTests.js",
"test:opam": "node ./tests/runOpamTests.js",
"test": "npm-run-all -s test:basic test:opam",
"package": "vsce package --out ocaml-platform.vsix --yarn --no-dependencies",
"deploy:vsce": "vsce publish --packagePath ocaml-platform.vsix --yarn --no-dependencies",
"deploy:ovsx": "ovsx publish --yarn --no-dependencies",
Expand Down Expand Up @@ -1214,6 +1214,7 @@
"@vscode/vsce": "2.21.1",
"esbuild": "0.19.5",
"fs-extra": "11.1.1",
"glob": "10.3.10",
"mocha": "10.2.0",
"npm-run-all": "4.1.5",
"ovsx": "0.8.3",
Expand Down
1 change: 0 additions & 1 deletion test/dune

This file was deleted.

47 changes: 0 additions & 47 deletions test/runEsyTests.js

This file was deleted.

39 changes: 0 additions & 39 deletions test/suite/esy.js

This file was deleted.

40 changes: 0 additions & 40 deletions test/suite/esy.test.js

This file was deleted.

39 changes: 0 additions & 39 deletions test/suite/opam.js

This file was deleted.

55 changes: 0 additions & 55 deletions test/suite/opam.test.js

This file was deleted.

39 changes: 0 additions & 39 deletions test/suite/problems.js

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ homepage: "foo"
description: "Description"
synopsis: "Synopsis"
bug-reports: "https//foo.bar"
depends: [
"ocaml" {>= "4.04.2" & < "5.00.0"}
"base" {>= "v0.12" }
]
depends: ["ocaml" "base"]
10 changes: 3 additions & 7 deletions test/runProblemMatcherTests.js → tests/runBasicTests.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
const path = require("path");
const path = require("node:path");

const { runTests } = require("@vscode/test-electron");

async function main() {
try {
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
const extensionDevelopmentPath = path.resolve(__dirname, "../");

// The path to the extension test script
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, "./suite/problems");
const extensionTestsPath = path.resolve(__dirname, "./suite/basic");

// Download VS Code, unzip it and run the integration test
await runTests({
extensionDevelopmentPath,
extensionTestsPath,
launchArgs: ["--disable-extensions"],
});
} catch (err) {
console.error(err);
console.error("Failed to run tests");
process.exit(1);
}
Expand Down
23 changes: 23 additions & 0 deletions tests/runEsyTests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const path = require("node:path");

const { runTests } = require("@vscode/test-electron");

async function main() {
try {
const extensionDevelopmentPath = path.resolve(__dirname, "../");

const extensionTestsPath = path.resolve(__dirname, "./suite/esy");

await runTests({
extensionDevelopmentPath,
extensionTestsPath,
launchArgs: ["--disable-extensions"],
});
} catch (err) {
console.error(err);
console.error("Failed to run tests");
process.exit(1);
}
}

main();
Loading