test: make OpenDBIObject config test immune to a leaked envMngr.get stub #2897
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Unit Test | |
| on: | |
| push: | |
| branches: [main, 'v[0-9]+.[0-9]+'] | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| node-version: | |
| description: 'Node.js version' | |
| required: true | |
| type: choice | |
| default: 'all' | |
| options: | |
| - 'all' | |
| - '22' | |
| - '24' | |
| - '26' | |
| jobs: | |
| unit-test: | |
| name: Unit Test (Node.js v${{ matrix.node-version }}) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: ${{ (github.event.inputs.node-version == 'all' || github.event.inputs.node-version == '') && fromJSON('[22, 24, 26]') || fromJSON(format('[{0}]', github.event.inputs.node-version)) }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| package-manager-cache: false | |
| - name: Install dependencies | |
| run: npm install --ignore-scripts | |
| - name: Build | |
| run: npm run build || true # we currently have type errors so just ignore that | |
| - name: Setup Harper | |
| env: | |
| DEFAULTS_MODE: 'dev' | |
| HDB_ADMIN_USERNAME: 'admin' | |
| HDB_ADMIN_PASSWORD: 'password' | |
| ROOTPATH: '/tmp/hdb' | |
| NODE_HOSTNAME: 'localhost' | |
| LOGGING_LEVEL: 'info' | |
| run: node --enable-source-maps ./dist/bin/harper.js install | |
| - name: Run tests | |
| run: npm run test:unit:all |