diff --git a/.github/workflows/compatibility.yaml b/.github/workflows/compatibility.yaml new file mode 100644 index 00000000..ee4cd02f --- /dev/null +++ b/.github/workflows/compatibility.yaml @@ -0,0 +1,56 @@ +name: nodejs Compatibility + +on: + push: + branches: + - "main" + - "3.0" + pull_request: + branches: + - "main" + - "3.0" + +jobs: + build: + runs-on: ubuntu-22.04 + strategy: + matrix: + node-version: [16.x, 20.x] + steps: + - name: Get TDengine + run: wget https://github.com/taosdata/TDengine/releases/download/ver-3.3.6.0/TDengine-server-3.3.6.0-Linux-x64.tar.gz + + - name: Install TDengine + run: | + tar -zxf TDengine-server-3.3.6.0-Linux-x64.tar.gz + rm -rf TDengine-server-3.3.6.0-Linux-x64.tar.gz + cd TDengine-server-3.3.6.0 + sudo ./install.sh -e no + + - name: Start TDengine + run: | + nohup sudo taosd & + nohup sudo taosadapter & + + - name: Checkout + uses: actions/checkout@v4 + with: + path: "nodejs-connector" + clean: true + set-safe-directory: true + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Run tests + working-directory: nodejs-connector/nodejs + env: + TDENGINE_CLOUD_URL: ${{ secrets.TDENGINE_CLOUD_URL }} + TDENGINE_CLOUD_TOKEN: ${{ secrets.TDENGINE_CLOUD_TOKEN }} + run: | + npm install + npm list + npm run example + npm run test diff --git a/nodejs/test/bulkPulling/tmq.test.ts b/nodejs/test/bulkPulling/tmq.test.ts index 13397f92..4df7010b 100644 --- a/nodejs/test/bulkPulling/tmq.test.ts +++ b/nodejs/test/bulkPulling/tmq.test.ts @@ -298,7 +298,7 @@ describe("TDWebSocket.Tmq()", () => { await consumer.subscribe(topics); } catch (e: any) { console.log(e); - expect(e.code).toBe(280); + expect([280, 65535]).toContain(e.code); } finally { if (consumer) { await consumer.close();