Skip to content

Commit

Permalink
(#547) Get rid of Docker tests
Browse files Browse the repository at this point in the history
  • Loading branch information
s1hofmann committed Dec 14, 2023
1 parent e0b7ac5 commit 1538576
Show file tree
Hide file tree
Showing 12 changed files with 5 additions and 111 deletions.
26 changes: 0 additions & 26 deletions .build/build.sh

This file was deleted.

16 changes: 0 additions & 16 deletions .build/run_linux.sh

This file was deleted.

9 changes: 0 additions & 9 deletions .build/run_osx.sh

This file was deleted.

9 changes: 0 additions & 9 deletions .build/setup_linux.sh

This file was deleted.

2 changes: 0 additions & 2 deletions .build/setup_osx.sh

This file was deleted.

6 changes: 0 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup Docker
run: |
docker pull s1hofmann/nut-ci:latest
docker run -it -d --name nut-ci --shm-size 8gb --user $(id -u):$(id -g) -v ${PWD}:${PWD}:rw s1hofmann/nut-ci:latest bash
- name: Install
run: npm ci
- name: Compile
Expand All @@ -38,8 +34,6 @@ jobs:
NODE_OPTIONS: "--max-old-space-size=8192"
with:
run: npm run coverage -- --coverageDirectory=coverage/unit
- name: Run Docker E2E tests
run: docker exec nut-ci bash -c "bash $PWD/.build/build.sh ${PWD} 14"
- name: Run Electron e2e test subpackage
uses: GabrielBB/xvfb-action@v1
with:
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/snapshot_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{matrix.node}}
- name: Setup Docker
if: ${{matrix.os == 'ubuntu-latest'}}
run: |
docker pull s1hofmann/nut-ci:latest
docker run -it -d --name nut-ci --shm-size 8gb --user $(id -u):$(id -g) -v ${PWD}:${PWD}:rw s1hofmann/nut-ci:latest bash
- name: Install
run: npm ci
- name: Install @nut-tree/libnut@next
Expand All @@ -43,9 +38,6 @@ jobs:
run: |
npx playwright install --with-deps
npm test
- name: Run Docker E2E tests
if: ${{matrix.os == 'ubuntu-latest'}}
run: docker exec nut-ci bash -c "bash $PWD/.build/build.sh ${PWD} 14"
- name: Run Electron e2e test subpackage
uses: GabrielBB/xvfb-action@v1
with:
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/tagged_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{matrix.node}}
- name: Setup Docker
if: ${{matrix.os == 'ubuntu-latest'}}
run: |
docker pull s1hofmann/nut-ci:latest
docker run -it -d --name nut-ci --shm-size 8gb --user $(id -u):$(id -g) -v ${PWD}:${PWD}:rw s1hofmann/nut-ci:latest bash
- name: Install
run: npm ci
- name: Compile
Expand All @@ -35,9 +30,6 @@ jobs:
run: |
npx playwright install --with-deps
npm test
- name: Run Docker E2E tests
if: ${{matrix.os == 'ubuntu-latest'}}
run: docker exec nut-ci bash -c "bash $PWD/.build/build.sh ${PWD} ${{matrix.node}}"
- name: Run Electron e2e test subpackage
uses: GabrielBB/xvfb-action@v1
with:
Expand Down
13 changes: 0 additions & 13 deletions lib/clipboard.class.e2e.spec.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@ import { mouse } from "../../../index";
import { Point } from "../../point.class";
import { toBeAt } from "./toBeAt.function";

jest.mock("jimp", () => {});

const targetPoint = new Point(100, 100);

describe(".toBeAt", () => {
beforeEach(() => {
mouse.setPosition(targetPoint);
});

it("should succeed when cursor is at right position.", async () => {
mouse.getPosition = jest.fn(() => Promise.resolve(targetPoint));
const result = await toBeAt(mouse, targetPoint);
expect(result.pass).toBeTruthy();
});

it("should fail when cursor is at wrong position.", async () => {
mouse.getPosition = jest.fn(() => Promise.resolve(targetPoint));
const result = await toBeAt(mouse, new Point(10, 10));
expect(result.pass).toBeFalsy();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,19 @@ import { Point } from "../../point.class";
import { Region } from "../../region.class";
import { toBeIn } from "./toBeIn.function";

jest.mock("jimp", () => {});

const targetPoint = new Point(400, 400);

describe(".toBeIn", () => {
beforeEach(() => {
mouse.setPosition(targetPoint);
});

it("should succeed when cursor is within correct region.", async () => {
const targetRegion = new Region(350, 350, 100, 100);
mouse.getPosition = jest.fn(() => Promise.resolve(targetPoint));
const result = await toBeIn(mouse, targetRegion);
expect(result.pass).toBeTruthy();
});

it("should fail when cursor is outside of search region.", async () => {
const targetRegion = new Region(0, 0, 100, 100);
mouse.setPosition(targetPoint);
mouse.getPosition = jest.fn(() => Promise.resolve(targetPoint));
const result = await toBeIn(mouse, targetRegion);
expect(result.pass).toBeFalsy();
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"test:e2e": "npm --prefix e2e/tests cit",
"coverage": "jest --coverage --runInBand --logHeapUsage",
"coverage:clean": "rimraf coverage",
"coverage:merge": "istanbul-merge --out coverage/merged/coverage-final.json ./coverage/unit/coverage-final.json ./coverage/e2e/coverage-final.json",
"coverage:merge": "istanbul-merge --out coverage/merged/coverage-final.json ./coverage/unit/coverage-final.json",
"coverage:merge-report": "nyc report --reporter=lcov --reporter=text --temp-dir=./coverage/merged --report-dir=./coverage/merged",
"watch": "tsc -w -p .",
"publish-next": "npm publish --tag next",
Expand Down

0 comments on commit 1538576

Please sign in to comment.