Skip to content

Commit

Permalink
[OV JS] Add e2e test of openvino-node package as electron app depende…
Browse files Browse the repository at this point in the history
…ncy (openvinotoolkit#25522)

### Details:
 - Implement initial e2e testing

### Tickets:
 - 146346

---------

Co-authored-by: Alicja Miloszewska <[email protected]>
  • Loading branch information
vishniakov-nikolai and almilosz authored Jul 22, 2024
1 parent f8c7ccc commit 9a7045d
Show file tree
Hide file tree
Showing 19 changed files with 638 additions and 62 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/job_openvino_js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:
DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input
OPENVINO_JS_DIR: ${{ github.workspace }}/openvino/src/bindings/js
OPENVINO_JS_LIBS_DIR: ${{ github.workspace }}/openvino/src/bindings/js/node/bin
NODE_VERSION: 20
NODE_VERSION: 21
DISPLAY: ':99'
steps:
- name: Fetch OpenVINO JS sources
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down Expand Up @@ -61,3 +62,13 @@ jobs:
- name: Test OpenVINO JS API
working-directory: ${{ env.OPENVINO_JS_DIR }}/node
run: npm run test

- name: Install electron deps and run Xvfb
if: runner.os == 'Linux'
run: |
apt-get update && apt-get install -y xvfb libgtk-3-0 libgbm1
Xvfb "$DISPLAY" &
- name: E2E of openvino-node package
working-directory: ${{ env.OPENVINO_JS_DIR }}/node
run: npm run test:e2e
23 changes: 18 additions & 5 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ jobs:
env:
OPENVINO_JS_DIR: "${{ github.workspace }}\\openvino\\src\\bindings\\js"
OPENVINO_JS_LIBS_DIR: "${{ github.workspace }}\\openvino\\src\\bindings\\js\\node\\bin"
NODE_VERSION: 21
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API

steps:
Expand All @@ -355,24 +356,36 @@ jobs:
name: openvino_js_package
path: ${{ env.OPENVINO_JS_LIBS_DIR }}

- name: Setup Node
- name: Setup Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
node-version: ${{ env.NODE_VERSION }}

- name: Configure OpenVINO JS
- name: Configure OpenVINO JS API
working-directory: ${{ env.OPENVINO_JS_DIR }}/node
run: npm i

- name: Test OpenVINO JS
- name: Test OpenVINO JS API
working-directory: ${{ env.OPENVINO_JS_DIR }}/node
run: npm test

- name: Test OpenVINO JS (cmd)
- name: Test OpenVINO JS API (cmd)
shell: cmd
working-directory: ${{ env.OPENVINO_JS_DIR }}/node
run: call npm test

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2

- name: E2E of openvino-node package
working-directory: ${{ env.OPENVINO_JS_DIR }}/node
run: npm run test:e2e

- name: E2E of openvino-node package (cmd)
shell: cmd
working-directory: ${{ env.OPENVINO_JS_DIR }}/node
run: call npm run test:e2e

- name: Create package dir
working-directory: ${{ env.OPENVINO_JS_DIR }}
run: mkdir project-uses-openvino-node
Expand Down
2 changes: 1 addition & 1 deletion samples/js/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"lint": "eslint ."
},
"engines": {
"node": ">=20.5.1"
"node": ">=21.0.0"
}
}
Loading

0 comments on commit 9a7045d

Please sign in to comment.