Skip to content
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { CacheModule } from '@nestjs/cache-manager';
import { ConfigModule } from '@nestjs/config';
import { Test } from '@nestjs/testing';

import { describe, expect, it } from 'vitest';
Expand All @@ -10,7 +11,11 @@ describe('Module Dependencies Integration', () => {
let module;
try {
module = await Test.createTestingModule({
imports: [CacheModule.register({ isGlobal: true }), RestModule],
imports: [
ConfigModule.forRoot({ ignoreEnvFile: true, isGlobal: true }),
CacheModule.register({ isGlobal: true }),
RestModule,
],
}).compile();

expect(module).toBeDefined();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { forwardRef, Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';

import { UserSettingsModule } from '@unraid/shared/services/user-settings.js';

Expand All @@ -7,7 +8,7 @@ import { OidcConfigPersistence } from '@app/unraid-api/graph/resolvers/sso/core/
import { OidcValidationService } from '@app/unraid-api/graph/resolvers/sso/core/oidc-validation.service.js';

@Module({
imports: [UserSettingsModule, forwardRef(() => OidcClientModule)],
imports: [ConfigModule, UserSettingsModule, forwardRef(() => OidcClientModule)],
providers: [OidcConfigPersistence, OidcValidationService],
exports: [OidcConfigPersistence, OidcValidationService],
})
Expand Down
52 changes: 0 additions & 52 deletions api/src/unraid-api/rest/__test__/rest-module-dependencies.test.ts

This file was deleted.

84 changes: 0 additions & 84 deletions api/src/unraid-api/rest/__test__/rest-module.integration.test.ts

This file was deleted.

132 changes: 0 additions & 132 deletions api/src/unraid-api/rest/__test__/rest.service.test.ts

This file was deleted.

1 change: 0 additions & 1 deletion api/src/unraid-api/rest/rest.controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ describe('RestController', () => {
{
provide: RestService,
useValue: {
getLogs: vi.fn(),
getCustomizationStream: vi.fn(),
},
},
Expand Down
15 changes: 0 additions & 15 deletions api/src/unraid-api/rest/rest.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,6 @@ export class RestController {
return 'OK';
}

@Get('/graphql/api/logs')
@UsePermissions({
action: AuthAction.READ_ANY,
resource: Resource.LOGS,
})
async getLogs(@Res() res: FastifyReply) {
try {
const logStream = await this.restService.getLogs();
return res.status(200).type('application/x-gtar').send(logStream);
} catch (error: unknown) {
this.logger.error(error);
return res.status(500).send(`Error: Failed to get logs`);
}
}

@Get('/graphql/api/customizations/:type')
@UsePermissions({
action: AuthAction.READ_ANY,
Expand Down
3 changes: 1 addition & 2 deletions api/src/unraid-api/rest/rest.module.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { Module } from '@nestjs/common';

import { CliServicesModule } from '@app/unraid-api/cli/cli-services.module.js';
import { RCloneModule } from '@app/unraid-api/graph/resolvers/rclone/rclone.module.js';
import { SsoModule } from '@app/unraid-api/graph/resolvers/sso/sso.module.js';
import { RestController } from '@app/unraid-api/rest/rest.controller.js';
import { RestService } from '@app/unraid-api/rest/rest.service.js';

@Module({
imports: [RCloneModule, CliServicesModule, SsoModule],
imports: [RCloneModule, SsoModule],
controllers: [RestController],
Comment on lines 3 to 10
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep ApiReportService wiring aligned with RestModule tests

RestModule now imports only the rclone and SSO modules (lines 3–10), so ApiReportService is no longer provided. The existing integration suites in api/src/unraid-api/rest/__test__/rest-module.integration.test.ts and rest-module-dependencies.test.ts still call Test.createTestingModule({ imports: [RestModule] }) and then retrieve ApiReportService, which will now fail with a missing provider error. Running the test suite will therefore fail immediately; either reintroduce the CliServicesModule provider/export chain or update those tests to reflect the removal.

Useful? React with 👍 / 👎.

providers: [RestService],
})
Expand Down
Loading
Loading