Skip to content
Draft
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
4 changes: 2 additions & 2 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ if [ $BLACK_EXIT_CODE -ne 0 ]; then
exit 1
fi

npx prettier -c .
pnpm exec prettier -c .
PRETTIER_EXIT_CODE=$?
if [ $PRETTIER_EXIT_CODE -ne 0 ]; then
echo "Code formatting issues detected. Please run 'npx prettier -w .' to format your code."
echo "Code formatting issues detected. Please run 'pnpm exec prettier -w .' to format your code."
exit 1
fi
exit 0
49 changes: 31 additions & 18 deletions .github/workflows/run-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ on:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
# Make corepack fetch the pnpm binary itself through Artifactory too, so no job
# ever reaches the public npm registry.
COREPACK_NPM_REGISTRY: https://artifactory.vi.vector.int/artifactory/api/npm/gen-npmjs-npm-remote-vis-01/
jobs:
unit-tests:
if: github.event.pull_request.draft == false
Expand Down Expand Up @@ -67,24 +71,27 @@ jobs:
if: failure()
uses: actions/checkout@v4

- name: Enable pnpm
run: corepack enable

- name: Restore cached dependencies
id: cache-dependencies-restore
uses: actions/cache/restore@v4
with:
path: |
node_modules
key: ${{ runner.os }}-dependencies-${{ hashFiles('package.json') }}
key: ${{ runner.os }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }}

- name: Install dependencies
if: steps.cache-dependencies-restore.outputs.cache-hit != 'true'
run: npm install
run: pnpm install --frozen-lockfile

- name: Save dependencies
if: steps.cache-dependencies-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: node_modules
key: ${{ runner.os }}-dependencies-${{ hashFiles('package.json') }}
key: ${{ runner.os }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }}

- name: Pull latest reqs2tests release
shell: bash
Expand Down Expand Up @@ -120,7 +127,7 @@ jobs:
shell: bash

- name: Run unit tests
run: npm run gh-test | tee output.txt
run: pnpm run gh-test | tee output.txt
shell: bash

- name: Publish unit tests results
Expand Down Expand Up @@ -243,21 +250,24 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- name: Enable pnpm
run: corepack enable

- name: Restore cached dependencies
uses: actions/cache/restore@v4
with:
path: node_modules
key: ${{ runner.os }}-dependencies-${{ hashFiles('package.json') }}
key: ${{ runner.os }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }}

- name: Install dependencies
if: steps.cache-dependencies-restore.outputs.cache-hit != 'true'
run: npm install
run: pnpm install --frozen-lockfile

- name: Package extension and list VSIX
run: |
npm run package
pnpm run package
echo "VSIX contents:"
npx vsce ls
pnpm exec vsce ls
VSIX_FILE=$(find . -maxdepth 2 -name "*.vsix" | head -n 1)
if [ -z "$VSIX_FILE" ]; then
echo "Error: vsix not found"
Expand Down Expand Up @@ -368,25 +378,28 @@ jobs:
if: failure()
uses: actions/checkout@v4

- name: Enable pnpm
run: corepack enable

- name: Restore cached dependencies
id: cache-dependencies-restore
uses: actions/cache/restore@v4
with:
path: |
node_modules
key: ${{ runner.os }}-dependencies-${{ hashFiles('package.json') }}
key: ${{ runner.os }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }}

- name: Install dependencies
if: steps.cache-dependencies-restore.outputs.cache-hit != 'true'
run: npm install
run: pnpm install --frozen-lockfile

- name: Save dependencies
if: steps.cache-dependencies-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
node_modules
key: ${{ runner.os }}-dependencies-${{ hashFiles('package.json') }}
key: ${{ runner.os }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }}

- name: Pull latest reqs2tests release
shell: bash
Expand Down Expand Up @@ -459,7 +472,7 @@ jobs:
- name: Package with VSCE
run: |
# Build a normal .vsix WITHOUT including the reqs2tests resources (we copied them to $GITHUB_WORKSPACE/resources)
npm run package
pnpm run package

# find the produced .vsix and expose its path to later steps
VSIX_FILE=$(find $GITHUB_WORKSPACE -maxdepth 2 -name "*.vsix" | head -n 1)
Expand All @@ -475,7 +488,7 @@ jobs:
with:
path: |
tests/internal/e2e/node_modules
key: ${{ runner.os }}-dependencies-${{ hashFiles('tests/internal/e2e/package.json') }}
key: ${{ runner.os }}-dependencies-${{ hashFiles('tests/internal/e2e/pnpm-lock.yaml') }}

- name: Restore cached dependencies - vscode
id: cache-dependencies-restore-vscode
Expand Down Expand Up @@ -545,7 +558,7 @@ jobs:
with:
path: |
tests/internal/e2e/node_modules
key: ${{ runner.os }}-dependencies-${{ hashFiles('tests/internal/e2e/package.json') }}
key: ${{ runner.os }}-dependencies-${{ hashFiles('tests/internal/e2e/pnpm-lock.yaml') }}

- name: Save dependencies - vscode
if: always() && steps.cache-dependencies-restore-vscode.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -631,8 +644,8 @@ jobs:
- name: Run prettier
shell: bash
run: |
npm install prettier@$(node -pe "require('./package').devDependencies.prettier")
npx prettier -c . > output.log 2>&1; echo $? > exitcode.txt
corepack enable
pnpm dlx prettier@$(node -pe "require('./package').devDependencies.prettier") -c . > output.log 2>&1; echo $? > exitcode.txt
- name: Summary
shell: bash
if: always()
Expand Down Expand Up @@ -679,8 +692,8 @@ jobs:
- name: Run xo
shell: bash
run: |
npm install xo@$(node -pe "require('./package').dependencies.xo")
npx xo tests/unit > output.log 2>&1; echo $? > exitcode.txt
corepack enable
pnpm dlx xo@$(node -pe "require('./package').dependencies.xo") tests/unit > output.log 2>&1; echo $? > exitcode.txt
- name: Summary
shell: bash
if: always()
Expand Down
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# All npm packages are fetched exclusively through Vector's Artifactory mirror
# (gen-npmjs-npm-remote-vis-01), never directly from the public npm registry.
registry=https://artifactory.vi.vector.int/artifactory/api/npm/gen-npmjs-npm-remote-vis-01/
5 changes: 4 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
!*.ts

# Check subdirectories too
!*/
!*/

# VS Code builds downloaded by wdio-vscode-service when e2e tests run locally
tests/internal/e2e/.wdio-vscode-service/
3 changes: 3 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ docker
.prettierignore
.xo-config.json
tsconfig_test.json
pnpm-lock.yaml
pnpm-workspace.yaml
.npmrc

# <— unignore webview assets
!src/manage/webviews/html/**
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,17 +483,18 @@ This extension is open-source, released under the MIT license, and we welcome yo
- [Submit Bugs and Feature Requests](https://github.com/vectorgrp/vector-vscode-vcast/issues)
- Implement improvements and [create a pull request](https://github.com/vectorgrp/vector-vscode-vcast/pulls)

- To install the dependencies necessary for building VectorCAST Test Explorer, run `npm install` in the root of the repository.
- This repository uses [pnpm](https://pnpm.io) as its package manager. The pinned version is declared in the `packageManager` field of `package.json`; run `corepack enable` once and the correct pnpm will be used automatically.
- To install the dependencies necessary for building VectorCAST Test Explorer, run `pnpm install` in the root of the repository.
- Make sure you have `vsce` installed globally
- To install `vsce`, run `npm install -g @vscode/vsce@^2.15.0`
- To build VectorCAST Test Explorer, run `npm run package` in the root of the repository
- To run existing unit tests for VectorCAST Test Explorer, run `npm test` in the root of the repository
- To install `vsce`, run `pnpm add -g @vscode/vsce@^2.15.0`
- To build VectorCAST Test Explorer, run `pnpm run package` in the root of the repository
- To run existing unit tests for VectorCAST Test Explorer, run `pnpm test` in the root of the repository
- Code and resources for unit tests can be found in `tests/unit`
- To run end-to-end tests (the end-to-end tests are meant for Vector internal usage):
- If behind a corporate proxy, point `NODE_EXTRA_CA_CERTS` to your certificate bundle
- Make sure you had built the extension already (run `npm run package` to build the extension)
- Run `npm install` in `tests/internal/e2e` to install necessary dependencies
- Run `npm test` in `tests/internal/e2e` to run the end-to-end tests
- Make sure you had built the extension already (run `pnpm run package` to build the extension)
- Run `pnpm install` in `tests/internal/e2e` to install necessary dependencies
- Run `pnpm test` in `tests/internal/e2e` to run the end-to-end tests
- More detailed instructions can be found in `tests/internal/e2e`


Expand Down
6 changes: 4 additions & 2 deletions docker/Ubuntu24-Dockerfile-CI
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ RUN sudo apt-get update && \
npm set -g noproxy $NO_PROXY && \
npm set -g proxy $HTTP_PROXY && \
npm set -g https-proxy $HTTPS_PROXY && \
npm set -g registry http://registry.npmjs.org/ && \
npm set -g registry https://artifactory.vi.vector.int/artifactory/api/npm/gen-npmjs-npm-remote-vis-01/ && \
npm i -g yo && \
npm install -g typescript && \
npm install -g esbuild && \
npm install -g tsx
npm install -g tsx && \
corepack enable && \
COREPACK_NPM_REGISTRY=https://artifactory.vi.vector.int/artifactory/api/npm/gen-npmjs-npm-remote-vis-01/ corepack prepare pnpm@10.34.4 --activate

# python
ARG PY_VERSION=3.8.18
Expand Down
Loading
Loading