-
-
Notifications
You must be signed in to change notification settings - Fork 12
fix(policy): sql execution error with before()
#373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,4 +77,6 @@ jobs: | |
| run: pnpm run lint | ||
|
|
||
| - name: Test | ||
| env: | ||
| TEST_DB_PROVIDER: ${{ matrix.provider }} | ||
| run: TEST_DB_PROVIDER=${{ matrix.provider }} pnpm run test | ||
|
Comment on lines
+80
to
82
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major Remove redundant environment variable assignment. The Apply this diff to remove the redundant prefix: env:
TEST_DB_PROVIDER: ${{ matrix.provider }}
- run: TEST_DB_PROVIDER=${{ matrix.provider }} pnpm run test
+ run: pnpm run test🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -1,5 +1,5 @@ | ||||
| import { describe, expect, it } from 'vitest'; | ||||
| import { createPolicyTestClient } from '@zenstackhq/testtools'; | ||||
| import { createPolicyTestClient, getTestDbProvider } from '@zenstackhq/testtools'; | ||||
|
|
||||
| describe('Policy post-update tests', () => { | ||||
| it('allows post-update by default', async () => { | ||||
|
|
@@ -94,6 +94,7 @@ describe('Policy post-update tests', () => { | |||
| }); | ||||
|
|
||||
| it('works with before function', async () => { | ||||
| console.log('PROVIDER:', getTestDbProvider()); | ||||
|
||||
| console.log('PROVIDER:', getTestDbProvider()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove debug logging before merging.
This console.log statement appears to be temporary debugging code. Debug artifacts should be removed from test files before merging to production.
Apply this diff to remove the debug statement:
- console.log('PROVIDER:', getTestDbProvider());After removing this line, if getTestDbProvider is no longer used in the file, also remove it from the import statement on line 2:
-import { createPolicyTestClient, getTestDbProvider } from '@zenstackhq/testtools';
+import { createPolicyTestClient } from '@zenstackhq/testtools';Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In tests/e2e/orm/policy/crud/post-update.test.ts around line 97, remove the
temporary debug statement "console.log('PROVIDER:', getTestDbProvider());" and
save the file; then check the import on line 2 and if getTestDbProvider is no
longer referenced anywhere in the file, remove it from that import to avoid an
unused import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The environment variable is now set redundantly both in the
envblock (line 81) and inline in theruncommand. The inlineTEST_DB_PROVIDER=${{ matrix.provider }}prefix should be removed since it's already defined in theenvsection above.