Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
Add missing OS to our CI
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock committed Dec 5, 2023
1 parent 8b3254c commit 09e488f
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 12 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,29 @@ name: CI
on: [push, pull_request]

jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: "18"
cache: "yarn"

- name: 📦 Install dependencies
run: yarn --frozen-lockfile

- name: Lint
run: yarn run lint

build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
Expand All @@ -24,8 +45,6 @@ jobs:
- name: 📦 Install dependencies
run: yarn --frozen-lockfile

- run: yarn run lint

- run: /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- run: yarn run test
env:
Expand Down
12 changes: 9 additions & 3 deletions src/test/suite/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ suite("Client", () => {
const currentManager = managerConfig.get("rubyVersionManager");
const tmpPath = fs.mkdtempSync(path.join(os.tmpdir(), "ruby-lsp-test-"));
const workspaceFolder: vscode.WorkspaceFolder = {
uri: vscode.Uri.parse(`file://${tmpPath}`),
uri: vscode.Uri.from({ scheme: "file", path: tmpPath }),
name: path.basename(tmpPath),
index: 0,
};
Expand Down Expand Up @@ -83,7 +83,13 @@ suite("Client", () => {
() => {},
workspaceFolder,
);
await client.start();

try {
await client.start();
} catch (error: any) {
assert.fail(error.message);
}

assert.strictEqual(client.state, State.Running);
}).timeout(30000);
}).timeout(60000);
});
2 changes: 1 addition & 1 deletion src/test/suite/debugger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ suite("Debugger", () => {
{
parallel: "1",
...ruby.env,
BUNDLE_GEMFILE: `${tmpPath}/.ruby-lsp/Gemfile`,
BUNDLE_GEMFILE: path.join(tmpPath, ".ruby-lsp", "Gemfile"),
},
configs.env,
);
Expand Down
12 changes: 7 additions & 5 deletions src/test/suite/ruby.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ suite("Ruby environment activation", () => {
let ruby: Ruby;

test("Activate fetches Ruby information when outside of Ruby LSP", async () => {
// eslint-disable-next-line no-process-env
process.env.SHELL = "/bin/bash";
if (os.platform() !== "win32") {
// eslint-disable-next-line no-process-env
process.env.SHELL = "/bin/bash";
}

const tmpPath = fs.mkdtempSync(path.join(os.tmpdir(), "ruby-lsp-test-"));
fs.writeFileSync(path.join(tmpPath, ".ruby-version"), "3.2.2");
Expand All @@ -30,10 +32,10 @@ suite("Ruby environment activation", () => {
);

assert.ok(ruby.rubyVersion, "Expected Ruby version to be set");
assert.strictEqual(
assert.notStrictEqual(
ruby.supportsYjit,
true,
"Expected YJIT support to be enabled",
undefined,
"Expected YJIT support to be set to true or false",
);

fs.rmSync(tmpPath, { recursive: true, force: true });
Expand Down

0 comments on commit 09e488f

Please sign in to comment.