You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2023/06/20 06:47:30 UTC
[plc4x] 02/03: test(plc4go/spi): new env PLC4X_TEST_PASS_LOGGER_TO_MODEL
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit e4ee3047b1cef9a648c53c85e1aab9873cc8b3c7
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Tue Jun 20 08:42:00 2023 +0200
test(plc4go/spi): new env PLC4X_TEST_PASS_LOGGER_TO_MODEL
---
plc4go/spi/testutils/TestUtils.go | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/plc4go/spi/testutils/TestUtils.go b/plc4go/spi/testutils/TestUtils.go
index 2f5dfc5a31..a11a94f383 100644
--- a/plc4go/spi/testutils/TestUtils.go
+++ b/plc4go/spi/testutils/TestUtils.go
@@ -121,6 +121,7 @@ func TestContext(t *testing.T) context.Context {
var (
highLogPrecision bool
traceExecutorWorkers bool
+ passLoggerToModel bool
)
func init() {
@@ -132,6 +133,10 @@ func init() {
if traceExecutorWorkersEnv := os.Getenv("PLC4X_TEST_TRACE_EXECUTOR_WORKERS"); traceExecutorWorkersEnv != "" {
traceExecutorWorkers = traceExecutorWorkersEnv == "true"
}
+ passLoggerToModel = true
+ if passLoggerToModelEnv := os.Getenv("PLC4X_TEST_PASS_LOGGER_TO_MODEL"); passLoggerToModelEnv != "" {
+ passLoggerToModel = passLoggerToModelEnv == "true"
+ }
}
// ProduceTestingLogger produces a logger which redirects to testing.T
@@ -169,7 +174,7 @@ func EnrichOptionsWithOptionsForTesting(t *testing.T, _options ...options.WithOp
}
_options = append(_options,
options.WithCustomLogger(ProduceTestingLogger(t)),
- options.WithPassLoggerToModel(true),
+ options.WithPassLoggerToModel(passLoggerToModel),
options.WithExecutorOptionTracerWorkers(traceExecutorWorkers),
)
// We always create a custom executor to ensure shared executor for transaction manager is not used for tests