From 56ae7a0db824706d1e254dcf85b8029bf1e9a745 Mon Sep 17 00:00:00 2001 From: Stijn Moreels <9039753+stijnmoreels@users.noreply.github.com> Date: Mon, 4 Nov 2024 10:26:54 +0100 Subject: [PATCH] docs: explain multi suite session (#219) * pr-fix: correct merge w/ 'main' * chore: eat your own logging dog food * docs: explain multi-suite active session id --- .../02-Features/06-Integration/01-data-factory.mdx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/preview/02-Features/06-Integration/01-data-factory.mdx b/docs/preview/02-Features/06-Integration/01-data-factory.mdx index effe3864..6379e039 100644 --- a/docs/preview/02-Features/06-Integration/01-data-factory.mdx +++ b/docs/preview/02-Features/06-Integration/01-data-factory.mdx @@ -49,7 +49,16 @@ await TemporaryDataFlowDebugSession.StartDebugSessionAsync(..., options => }); ``` -> 💡 The `ActiveSessionId` is useful when developing locally when you do not want to start/stop the debug session on every run. But this also means that in case an active session is found, it will not be teardown when the test fixture disposes. This follows the 'clean environment' principle that test fixtures should only be responsible for the things they set up. +> #### 💡 Leveraging the `ActiveSessionId` option +> The `ActiveSessionId` is useful when developing locally when you do not want to start/stop the debug session on every run. But this also means that in case an active session is found, it will not be teardown when the test fixture disposes. This follows the 'clean environment' principle that test fixtures should only be responsible for the things they set up. +> +> ⚡ Because of this functionality, you can even use the same debug session across different test suites/projects. These things need to happen to set this up: +> +> 1. Run a **custom script** task before any of the test suites to start a debug session. +> 2. Set a new **pipeline variable with the session ID** of the active debug session. +> 3. Get the pipeline variable in your tests suites to assign it to the `ActiveSessionId` option. +> 4. Run a custom script after all the test suites to stop the debug session. +> * ⚠️ **_Make sure that this always runs, even if the tests fail._** ### Full example The following snippet provides a full examples of how the `TemporaryDataFlowDebugSession` test fixture can be used as a singleton test fixture across tests.