kuttl icon indicating copy to clipboard operation
kuttl copied to clipboard

[Bug] Parallel in TestSuite is ignored if the harness is used directly

Open davidLif opened this issue 2 years ago • 0 comments

What happened: I have the following code:

options := harness.TestSuite{
        TestDirs: []string{suiteDir},
	Config: &harness.RestConfig{
		RC: ctx.KubeConfig,
	},
	Namespace: crdUtils.GetNamespaceName(ctx.Projects[0]),
	Timeout:   60,
        Parallel:  1,
}
testHarness := test.Harness{
	TestSuite: options,
	T:         t,
}
       
testHarness.Run()

When the suiteDir contains 2 tests (2 subdirectories, each with tests files), both of the run in parallel

What you expected to happen: The tests should run one after the other, because the configuration I set states Parallel: 1

How to reproduce it (as minimally and precisely as possible): Use the code I wrote above with 2 seperate tests

Anything else we need to know?: In the method RunTests of harness, t.Parallel() is called for each tests, without checking the value of Parallel in the configuration. from what I have been able to see in the repo, only tests called by the CLI will be infuenced by this option.

Environment:

  • Kubernetes version (use kubectl version):
  • KUTTL version (use kubectl kuttl version):
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

davidLif avatar Dec 17 '22 23:12 davidLif