Skip to content

Including DD_TRACE_ESM_IMPORT & DD_TRACE_PACKAGE causes an unsuccessful prisma migrate command in CI #40

@AnishSDET1

Description

@AnishSDET1

Issue

Including the following in GHA

NODE_OPTIONS: -r ${{ env.DD_TRACE_PACKAGE }} --import ${{ env.DD_TRACE_ESM_IMPORT }} causes the following command

**pnpm prisma migrate dev --schema libs/data/src/schema.prisma**

to be unsuccessful with no output and therefore unable to run our unit tests with vitest & DataDog Trace.

NOTE without NODE_OPTIONS: -r ${{ env.DD_TRACE_PACKAGE }} --import ${{ env.DD_TRACE_ESM_IMPORT }} this command works perfectly fine and starts logging the migration without any issues such as

Prisma schema loaded from libs/data/src/schema.prisma
Datasource "db": MySQL database "test_app" at "127.0.0.1:3306"
MySQL database test_app created at 127.0.0.1:3306
Applying migration `20210203112813_init`
Applying migration `20210222120942_remove`
......

So there is some kind of issue when including DD_TRACE_PACKAGE or DD_TRACE_ESM_IMPORT or both which causes prisma commands execution issues i.e. not able to execute these prisma commands.

Environment

GHA running on ubuntu

GHA File

name: Test
on:

env:
  DD_API_KEY: ${{ secrets.DD_API_KEY }}
jobs:
  tests:
    name: Run tests
    runs-on: ubuntu-latest
    timeout-minutes: 15
    strategy:
      fail-fast: false
      matrix:
        app: [test_app]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
      - name: Install dependencies
        run: pnpm install

      - name: Configure Datadog Test Optimization
        uses: datadog/test-visibility-github-action@v2
        with:
          api_key: ${{ env.DD_API_KEY }}
          languages: js
          service: ${{ matrix.app }}
          site: datadoghq.eu

      - name: Run prisma migrate
        run: pnpm prisma migrate dev --schema libs/data/src/schema.prisma
        env:
          NODE_OPTIONS: -r ${{ env.DD_TRACE_PACKAGE }} --import ${{ env.DD_TRACE_ESM_IMPORT }}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions