From 1d839e84e3d3c54a628f7a74bc8d79243505365c Mon Sep 17 00:00:00 2001 From: John Chilton Date: Fri, 22 Nov 2024 09:51:04 -0500 Subject: [PATCH 01/17] Cleanup debug logging in terminal.ts. --- .../Workflow/Editor/modules/terminals.test.ts | 12 ++++++++++++ .../components/Workflow/Editor/modules/terminals.ts | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/client/src/components/Workflow/Editor/modules/terminals.test.ts b/client/src/components/Workflow/Editor/modules/terminals.test.ts index f72e83896ab7..8cfe67082545 100644 --- a/client/src/components/Workflow/Editor/modules/terminals.test.ts +++ b/client/src/components/Workflow/Editor/modules/terminals.test.ts @@ -25,6 +25,7 @@ import { InputParameterTerminal, InputTerminal, InvalidOutputTerminal, + NO_COLLECTION_TYPE_INFORMATION_MESSAGE, OutputCollectionTerminal, OutputParameterTerminal, OutputTerminal, @@ -50,6 +51,17 @@ function useStores(id = "mock-workflow") { }; } +// Suppress debug messages about node configurations, we're testing esoteric things here - +// we might want these messages at runtime to help debug complex things but we don't need it +// during unit testing. +jest.spyOn(console, "debug").mockImplementation( + jest.fn((msg) => { + if (msg != NO_COLLECTION_TYPE_INFORMATION_MESSAGE) { + console.debug(msg); + } + }) +); + function setupAdvanced() { const terminals: { [index: string]: { [index: string]: ReturnType } } = {}; diff --git a/client/src/components/Workflow/Editor/modules/terminals.ts b/client/src/components/Workflow/Editor/modules/terminals.ts index 49effcb402fe..8221133278df 100644 --- a/client/src/components/Workflow/Editor/modules/terminals.ts +++ b/client/src/components/Workflow/Editor/modules/terminals.ts @@ -21,6 +21,9 @@ import { NULL_COLLECTION_TYPE_DESCRIPTION, } from "./collectionTypeDescription"; +export const NO_COLLECTION_TYPE_INFORMATION_MESSAGE = + "No collection type or collection type source defined - this is fine but may lead to less intuitive connection logic."; + export class ConnectionAcceptable { reason: string | null; canAccept: boolean; @@ -757,7 +760,7 @@ export class OutputCollectionTerminal extends BaseOutputTerminal { } else { this.collectionTypeSource = attr.collection_type_source; if (!this.collectionTypeSource) { - console.log("Warning: No collection type or collection type source defined."); + console.debug(NO_COLLECTION_TYPE_INFORMATION_MESSAGE); } this.collectionType = this.getCollectionTypeFromInput() || ANY_COLLECTION_TYPE_DESCRIPTION; } From 20c8f2b396a277ee2e0d47b78c4f324d4972eb51 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Fri, 22 Nov 2024 10:02:57 -0500 Subject: [PATCH 02/17] Get rid of scary icon warnings when running EditSecretsForm.test.ts --- client/src/components/ConfigTemplates/VaultSecret.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/components/ConfigTemplates/VaultSecret.vue b/client/src/components/ConfigTemplates/VaultSecret.vue index fe231af18417..4c6140ddbbb9 100644 --- a/client/src/components/ConfigTemplates/VaultSecret.vue +++ b/client/src/components/ConfigTemplates/VaultSecret.vue @@ -1,9 +1,14 @@