pmm icon indicating copy to clipboard operation
pmm copied to clipboard

Improve tests execution time by running them in-parallel

Open taraskozub-percona opened this issue 2 years ago • 3 comments

Description

managed tests execution takes around 20m in GitHub and should be improved by optimizing tests and/or running them in parallel.

Suggested solution

Apply t.Parallel() where it's possible

Additional context

Target package: https://github.com/percona/pmm/tree/main/managed How to run tests in parralell: https://eleni.blog/2019/05/11/parallel-test-execution-in-go/

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

taraskozub-percona avatar Sep 21 '22 12:09 taraskozub-percona

Can you point me to the location of the tests? Thx! 😄

erinlkolp avatar Sep 26 '22 00:09 erinlkolp

@erinlkolp Hello, this ticket mainly about managed component tests: https://github.com/percona/pmm/tree/main/managed So almost every package there has _test.go files. Some tests rely on database state, so not every test can be parallelized. However a lot of them can.

Managed tests works only inside devcontainer, so your actions will be like:

  1. clone pmm repo git clone [email protected]:percona/pmm.git
  2. run make env-up in the project root folder
  3. run make env to step in devcontainer
  4. run cd managed to change root to the managed folder
  5. modify tests
  6. run make test to run managed tests
  7. check that all tests are passing

artemgavrilov avatar Sep 26 '22 16:09 artemgavrilov

@artemgavrilov Thank you so much! My son and I will be taking a crack at this!

erinlkolp avatar Sep 26 '22 18:09 erinlkolp