Skip to content
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

chore(test): allow persistent outbox #142

Merged
merged 3 commits into from
Dec 12, 2023
Merged
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
3 changes: 3 additions & 0 deletions test/resources/bookshop-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"kind": "mocked"
}
},
"features": {
Copy link
Contributor

@johannes-vogel johannes-vogel Dec 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which feature flag is this?
instead db.kind = 'sql'?

Copy link
Contributor Author

@sjvans sjvans Dec 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it enables use of in-memory db in production. defaults to true in development. kind sql would become hana in this test that uses node_env production.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, didn't see that this is for production tests.

"in_memory_db": true
},
"cdsc": {
"docs": true
}
Expand Down
8 changes: 1 addition & 7 deletions test/tests/logger-prod.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,14 @@ describe('graphql - query logging with sanitization in production', () => {
const { gql } = require('../util')
const util = require('util')

const PROJECT_PATH = path.join(__dirname, '../resources/bookshop-graphql')

const { axios, GET, POST, data } = cds.test(PROJECT_PATH)
const { axios, GET, POST, data } = cds.test(path.join(__dirname, '../resources/bookshop-graphql'))
// Prevent axios from throwing errors for non 2xx status codes
axios.defaults.validateStatus = false

const _format = e => util.formatWithOptions({ colors: false, depth: null }, ...(Array.isArray(e) ? e : [e]))

let _log

beforeAll(async () => {
await cds.deploy(path.join(PROJECT_PATH, 'srv'))
})

beforeEach(async () => {
await data.reset()
_log = jest.spyOn(console, 'info')
Expand Down