Skip to content

Add main configuration file for tests #759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 17, 2024

Conversation

mrodm
Copy link
Contributor

@mrodm mrodm commented Jun 5, 2024

What does this PR do?

Adds a new configuration file to define global settings for tests: _dev/test/config.yml

Why is it important?

This configuration file is going to be used to define if tests of specific runners could be run in parallel or they should be run sequentially.

Example of the contents of this configuration file:

system:
  parallel: true
policy:
  parallel: false
  skip:
    reason: flaky tests
    link: https://github.com/elastic/package-spec/issues/1

Checklist

Related issues

@mrodm mrodm self-assigned this Jun 5, 2024
Comment on lines +9 to +10
static:
parallel: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Maybe we can also use this common config to skip all the tests of a kind.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a new field skip in every kind of tests ? Something like this?

static:
  parallel: false
  skip: true

IIUC that would avoid to add the skip field in every test config file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this would be useful for example to disable all system tests if there is some issue with the service deployment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added skip. 👍

I also renamed parallel to be sequential, not sure if that would be better or not.

Thinking in elastic-package , if sequential is not defined it means is false by default, and therefore tests could be run in parallel.

WDYT ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I prefer parallel to sequential, but not a strong opinion, as you prefer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set parallel again with default value false.
That would allow us to enable parallel tests just in the desired packages, not forcing to run all the system tests of all packages in parallel. There could be several packages that could not run those tests in parallel:

  • hardcoded exposed ports in services
  • running tests in kubernetes
  • running tests creating resources in terraform (there could be some limits creating resources for instance)

system:
parallel: true
policy:
parallel: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered having one file per test directory? I guess it depends on what is going to read this config. If it is going to be read by the commands it is fine here, if it is going to be read by the runners, I think it would be better in each test directory. But not a strong opinion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files should be read/parsed before triggering all tests.
Currently, this means to be read in the command definitions. There is where the tests are triggered.

There is an option to move all the logic to get all tests to each runner. If so, then these files could be read in each runner before triggering any test.

@elasticmachine
Copy link

💚 Build Succeeded

History

cc @mrodm

@mrodm mrodm merged commit 572e547 into elastic:main Jun 17, 2024
3 checks passed
@mrodm mrodm deleted the add_main_configuration_file_tests branch June 17, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants