Skip to content
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

Instantiate runners directly on test commands #1888

Merged
merged 11 commits into from
Jun 6, 2024

Conversation

mrodm
Copy link
Contributor

@mrodm mrodm commented Jun 5, 2024

Relates #787
Follows #1886

This PR instantiates in each command the corresponding runner, for that new constructors have been added into each runner. This allows us to create independent Options structs for each runner with just the required options for each runner.

These changes allow to remove the registry of the runners.

For now, it is kept the TestRunner interface since that will force to define Run and TearDown methods so they can be used in testrunner.Run()

@mrodm mrodm self-assigned this Jun 5, 2024
@mrodm mrodm changed the title Instantiate runners direclty on test commands Instantiate runners directly on test commands Jun 5, 2024
@mrodm mrodm force-pushed the call_runners_from_command branch from 3471042 to e5002af Compare June 5, 2024 11:30
@mrodm mrodm marked this pull request as ready for review June 5, 2024 12:15
@mrodm mrodm requested a review from a team June 5, 2024 12:15
Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

Nice. This change goes in the good direction 👍

runner := asset.NewAssetRunner(asset.AssetRunnerOptions{
TestFolder: testrunner.TestFolder{Package: pkg},
PackageRootPath: packageRootPath,
KibanaClient: kibanaClient,
Copy link
Member

Choose a reason for hiding this comment

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

Good to have specific option types 👍

internal/testrunner/runners/pipeline/runner.go Outdated Show resolved Hide resolved
internal/testrunner/runners/policy/runner.go Show resolved Hide resolved
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @mrodm

@mrodm mrodm merged commit c18a9ce into elastic:main Jun 6, 2024
3 checks passed
@mrodm mrodm deleted the call_runners_from_command branch June 6, 2024 09:52
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