From 6d96172f80203178a1df369a5e9d16dacb3cf103 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Tue, 25 Jun 2024 17:37:19 +0200 Subject: [PATCH] make sure 1 and only 1 OCR config is set in TOML --- integration-tests/testsetups/ocr.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/integration-tests/testsetups/ocr.go b/integration-tests/testsetups/ocr.go index 81de546c2b8..8d797926607 100644 --- a/integration-tests/testsetups/ocr.go +++ b/integration-tests/testsetups/ocr.go @@ -116,6 +116,14 @@ func WithForwarderFlow(forwarderFlow bool) OCRSoakTestOption { // NewOCRSoakTest creates a new OCR soak test to setup and run func NewOCRSoakTest(t *testing.T, config *tc.TestConfig, opts ...OCRSoakTestOption) (*OCRSoakTest, error) { + if config.OCR2 != nil && config.OCR != nil { + return nil, fmt.Errorf("both OCR and OCR2 are set. Please check your TOML config and make sure you only have one of them set") + } + + if config.GetActiveOCRConfig() == nil { + return nil, fmt.Errorf("no OCR[1/2] config not set. Please check your TOML config and make sure you have an OCR[1/2] config set") + } + test := &OCRSoakTest{ Config: config, TestReporter: testreporters.OCRSoakTestReporter{