Skip to content

Commit b310ea3

Browse files
authored
Merge pull request #251 from AthennaIO/develop
chore: remove trace options from arguments
2 parents 83a53a7 + 43aff21 commit b310ea3

6 files changed

Lines changed: 6 additions & 34 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@athenna/core",
3-
"version": "5.15.0",
3+
"version": "5.16.0",
44
"description": "One foundation for multiple applications.",
55
"license": "MIT",
66
"author": "João Lenon <lenon@athenna.io>",

src/applications/Cron.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export class Cron {
1919
*/
2020
public static async boot(options?: CronOptions): Promise<CronImpl> {
2121
options = Options.create(options, {
22-
trace: Config.get('cron.trace', false),
2322
routePath: Path.routes(`cron.${Path.ext()}`),
2423
kernelPath: '@athenna/cron/kernels/CronKernel'
2524
})
@@ -53,7 +52,7 @@ export class Cron {
5352

5453
const kernel = new Kernel()
5554

56-
await kernel.registerRTracer(options.trace)
55+
await kernel.registerRTracer()
5756
await kernel.registerExceptionHandler(options.exceptionHandlerPath)
5857
await kernel.registerSchedulers()
5958
await kernel.registerRoutes(options.routePath)

src/types/CronOptions.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@
88
*/
99

1010
export type CronOptions = {
11-
/**
12-
* Create a custom trace uuid to all new requests done to the server using AsyncLocalStorage.
13-
*
14-
* @default Config.get('cron.trace', false)
15-
*/
16-
trace?: boolean
17-
1811
/**
1912
* The path to the cron routes.
2013
*

tests/unit/applications/CronTest.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import { Path } from '@athenna/common'
1212
import { Cron } from '#src/applications/Cron'
1313
import { CommanderHandler } from '@athenna/artisan'
1414
import { Log, LoggerProvider } from '@athenna/logger'
15+
import { Cron as CronFacade, CronProvider, CronBuilder } from '@athenna/cron'
1516
import { Test, type Context, BeforeEach, AfterEach, Mock } from '@athenna/test'
16-
import { Cron as CronFacade, CronProvider, CronKernel, CronBuilder } from '@athenna/cron'
1717

1818
export default class CronTest {
1919
private cronBuilder: CronBuilder
@@ -63,15 +63,6 @@ export default class CronTest {
6363
assert.calledOnceWith(Log.info, 'importing CustomCronExceptionHandler')
6464
}
6565

66-
@Test()
67-
public async shouldBeAbleToBootACronApplicationWithTracingPluginRegistered({ assert }: Context) {
68-
Mock.when(CronKernel.prototype, 'registerRTracer').resolve(undefined)
69-
70-
await Cron.boot({ trace: true })
71-
72-
assert.calledOnceWith(CronKernel.prototype.registerRTracer, true)
73-
}
74-
7566
@Test()
7667
public async shouldBeAbleToBootACronApplicationAndRegisterTheRouteFile({ assert }: Context) {
7768
await Cron.boot({ routePath: Path.fixtures('routes/cron.ts') })

tests/unit/applications/HttpTest.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import { Path } from '@athenna/common'
1212
import { Http } from '#src/applications/Http'
1313
import { CommanderHandler } from '@athenna/artisan'
1414
import { Log, LoggerProvider } from '@athenna/logger'
15+
import { HttpServerProvider, HttpRouteProvider, Server } from '@athenna/http'
1516
import { Test, type Context, BeforeEach, AfterEach, Mock } from '@athenna/test'
16-
import { HttpServerProvider, HttpRouteProvider, Server, HttpKernel } from '@athenna/http'
1717

1818
export default class HttpTest {
1919
@BeforeEach()
@@ -82,17 +82,6 @@ export default class HttpTest {
8282
assert.calledOnceWith(Server.listen, { host: '127.0.0.1', port: 3000 })
8383
}
8484

85-
@Test()
86-
public async shouldBeAbleToBootAHttpApplicationWithTracingPluginRegistered({ assert }: Context) {
87-
Mock.when(HttpKernel.prototype, 'registerRTracer').resolve(undefined)
88-
Server.when('listen').resolve(undefined)
89-
90-
await Http.boot({ trace: true })
91-
92-
assert.calledOnceWith(Server.listen, { host: '127.0.0.1', port: 3000 })
93-
assert.calledOnceWith(HttpKernel.prototype.registerRTracer, true)
94-
}
95-
9685
@Test()
9786
public async shouldBeAbleToBootAHttpApplicationAndRegisterTheRouteFile({ assert }: Context) {
9887
Server.when('listen').resolve(undefined)

0 commit comments

Comments
 (0)