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

Improve module test output #1118

Merged
merged 2 commits into from
Aug 17, 2024
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
30 changes: 21 additions & 9 deletions packages/lib-apiclient/src/generated/api.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* Takaro API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
* The version of the OpenAPI document: unset-unset-unset
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
Expand Down Expand Up @@ -6148,6 +6148,12 @@ export interface PlayerOutputDTO {
* @memberof PlayerOutputDTO
*/
steamNumberOfVACBans?: number;
/**
*
* @type {number}
* @memberof PlayerOutputDTO
*/
steamLevel?: number;
/**
*
* @type {Array<PlayerOnGameserverOutputDTO>}
Expand Down Expand Up @@ -6294,6 +6300,12 @@ export interface PlayerOutputWithRolesDTO {
* @memberof PlayerOutputWithRolesDTO
*/
steamNumberOfVACBans?: number;
/**
*
* @type {number}
* @memberof PlayerOutputWithRolesDTO
*/
steamLevel?: number;
/**
*
* @type {Array<PlayerOnGameserverOutputDTO>}
Expand Down Expand Up @@ -7891,10 +7903,10 @@ export interface TakaroEventCommandExecuted {
data: any;
/**
*
* @type {Array<TakaroEventFunctionResult>}
* @type {TakaroEventFunctionResult}
* @memberof TakaroEventCommandExecuted
*/
result: Array<TakaroEventFunctionResult>;
result: TakaroEventFunctionResult;
/**
*
* @type {TakaroEventCommandDetails}
Expand Down Expand Up @@ -7941,10 +7953,10 @@ export interface TakaroEventCronjobExecuted {
data: any;
/**
*
* @type {Array<TakaroEventFunctionResult>}
* @type {TakaroEventFunctionResult}
* @memberof TakaroEventCronjobExecuted
*/
result: Array<TakaroEventFunctionResult>;
result: TakaroEventFunctionResult;
/**
*
* @type {TakaroEventCronjobDetails}
Expand Down Expand Up @@ -8079,10 +8091,10 @@ export interface TakaroEventHookExecuted {
data: any;
/**
*
* @type {Array<TakaroEventFunctionResult>}
* @type {TakaroEventFunctionResult}
* @memberof TakaroEventHookExecuted
*/
result: Array<TakaroEventFunctionResult>;
result: TakaroEventFunctionResult;
/**
*
* @type {TakaroEventHookDetails}
Expand Down
6 changes: 3 additions & 3 deletions packages/lib-apiclient/src/generated/base.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* Takaro API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
* The version of the OpenAPI document: unset-unset-unset
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
Expand Down
6 changes: 3 additions & 3 deletions packages/lib-apiclient/src/generated/common.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* Takaro API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
* The version of the OpenAPI document: unset-unset-unset
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
Expand Down
6 changes: 3 additions & 3 deletions packages/lib-apiclient/src/generated/configuration.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* Takaro API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
* The version of the OpenAPI document: unset-unset-unset
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
Expand Down
6 changes: 3 additions & 3 deletions packages/lib-apiclient/src/generated/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* Takaro API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
* The version of the OpenAPI document: unset-unset-unset
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
Expand Down
6 changes: 3 additions & 3 deletions packages/lib-modules/src/dto/takaroEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class TakaroEventCommandExecuted extends BaseEvent<TakaroEventCommandExec
@IsDefined()
data: Record<string, unknown>;

@ValidateNested({ each: true })
@ValidateNested()
@Type(() => TakaroEventFunctionResult)
result: TakaroEventFunctionResult;

Expand All @@ -161,7 +161,7 @@ export class TakaroEventHookExecuted extends BaseEvent<TakaroEventHookExecuted>
@IsDefined()
data: Record<string, unknown>;

@ValidateNested({ each: true })
@ValidateNested()
@Type(() => TakaroEventFunctionResult)
result: TakaroEventFunctionResult;

Expand All @@ -178,7 +178,7 @@ export class TakaroEventCronjobExecuted extends BaseEvent<TakaroEventCronjobExec
@IsDefined()
data: Record<string, unknown>;

@ValidateNested({ each: true })
@ValidateNested()
@Type(() => TakaroEventFunctionResult)
result: TakaroEventFunctionResult;

Expand Down
17 changes: 16 additions & 1 deletion packages/test/src/integrationTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'reflect-metadata';
import { matchSnapshot } from './snapshots.js';
import { integrationConfig, sandbox } from './main.js';
import { expect } from './test/expect.js';
import { AdminClient, Client, AxiosResponse, isAxiosError } from '@takaro/apiclient';
import { AdminClient, Client, AxiosResponse, isAxiosError, TakaroEventCommandExecuted } from '@takaro/apiclient';
import { randomUUID } from 'crypto';
import { retry } from '@takaro/util';

Expand Down Expand Up @@ -138,6 +138,21 @@ export class IntegrationTest<SetupData> {
}

if (integrationTestContext.standardDomainId) {
try {
const failedFunctionsRes = await integrationTestContext.client.event.eventControllerGetFailedFunctions();

if (failedFunctionsRes.data.data.length > 0) {
console.error(`There were ${failedFunctionsRes.data.data.length} failed functions`);
for (const failedFn of failedFunctionsRes.data.data) {
const name = (failedFn.meta as TakaroEventCommandExecuted).command?.name;
const msgs = (failedFn.meta as TakaroEventCommandExecuted)?.result.logs.map((l) => l.msg);
console.log(`Function with name "${name}" failed with messages: ${msgs}`);
}
}
} catch (_error) {
// Ignore, just reporting
}

try {
await integrationTestContext.adminClient.domain.domainControllerRemove(
integrationTestContext.standardDomainId,
Expand Down
Loading