Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

feat: support for running feature files #1193

Merged
merged 21 commits into from
May 26, 2021

Conversation

mdelapenya
Copy link
Contributor

@mdelapenya mdelapenya commented May 21, 2021

What does this PR do?

This PR adds support for running feature files, without changing how the TAGS filters are used.

  • extracts common logic to run the tests to a common-test.mk file.
  • create a Makefile for each test suite, providing each test suite the run tests command, like in a build system for a multi-module project. This new file imports the new common file.
  • adds support to filter the test runner by feature file, so that the run tests command is able to select one or more feature files.

We are also documenting how the CI is spreading the scenarios in the workers, using the .e2e-tests.yaml descriptor.

Finally, it improves the docs related the variables that affect the build, including TAGS and FEATURES.

Why is it important?

This PR is the first step to simplify how the scenarios are spread in the parallel workers: nowadays it's using TAGS, but and the end of the day we are using feature files (using the tag for the entire feature file).

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have run the Unit tests (make unit-test), and they are passing locally
  • I have run the End-2-End tests for the suite I'm working on, and they are passing locally
  • I have noticed new Go dependencies (run make notice in the proper directory)

How to test this PR locally

Default execution:
It will run all feature files, filtered by the backend_processes && debian && install tags.

TAGS="backend_processes && debian && install" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE BEATS_USE_CI_SNAPSHOT=true  DEVELOPER_MODE=true make -C e2e         functional-test

Running with features:
It will run the fleet_mode_agent.feature file, filtering by the backend_processes && debian && install tags.

FEATURES="fleet_mode_agent.feature" TAGS="backend_processes && debian && install" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE BEATS_USE_CI_SNAPSHOT=true  DEVELOPER_MODE=true make -C e2e functional-test

Related issues

Follow-ups

We need to update the e2e YAML descriptor to match this new features approach, updating the Jenkinsfile to spread feature files into the parallel execution. Besides that, we could generate the descriptor on the fly, based on the existing feature files.

@mdelapenya mdelapenya self-assigned this May 21, 2021
@mdelapenya mdelapenya requested a review from a team May 21, 2021 08:34
@elasticmachine
Copy link
Contributor

elasticmachine commented May 21, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #1193 updated

  • Start Time: 2021-05-25T21:42:19.810+0000

  • Duration: 21 min 23 sec

  • Commit: cd516bf

Test stats 🧪

Test Results
Failed 0
Passed 160
Skipped 0
Total 160

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 160
Skipped 0
Total 160

@mdelapenya
Copy link
Contributor Author

jenkins run the tests please

@mdelapenya mdelapenya marked this pull request as ready for review May 24, 2021 17:45
Co-authored-by: cachedout <[email protected]>
@adam-stokes adam-stokes merged commit 888ecfe into elastic:master May 26, 2021
mergify bot pushed a commit that referenced this pull request May 26, 2021
* chore: update unit tests docs in PR template

* docs: document configurations location

* docs: document how the CI spreads feature files and tags

* chore: extract build logic to commons

* chore: create build scripts per test suite

This way each test suite will control its own life cycle

* chore: update scripts used by CI

* chore: remove extracted code from the original makefile

* chore: remove unused variables in makefile

* docs: update how to use the make goals

* fix: move build-docs back to the original makefile

* chore: move lint back to the original makefile

* feat: support passing feature file to the test runner

It will accept the file name of a feature file, otherwise, it will run
all feature files under the 'features/' directory, as it did before this
change.

* docs: add features to the docs

* docs: document TAGS and FEATURES as variables affecting the build

* fix: update tag in docs

* docs: include default value for features

* chore: move SKIP_SCENARIOS next to related

* docs: explain that SKIP is added to the TAGS variable

* fix: typo

* chore: grammar in docs

Co-authored-by: cachedout <[email protected]>

Co-authored-by: cachedout <[email protected]>
Co-authored-by: Adam Stokes <[email protected]>
(cherry picked from commit 888ecfe)
mergify bot pushed a commit that referenced this pull request May 26, 2021
* chore: update unit tests docs in PR template

* docs: document configurations location

* docs: document how the CI spreads feature files and tags

* chore: extract build logic to commons

* chore: create build scripts per test suite

This way each test suite will control its own life cycle

* chore: update scripts used by CI

* chore: remove extracted code from the original makefile

* chore: remove unused variables in makefile

* docs: update how to use the make goals

* fix: move build-docs back to the original makefile

* chore: move lint back to the original makefile

* feat: support passing feature file to the test runner

It will accept the file name of a feature file, otherwise, it will run
all feature files under the 'features/' directory, as it did before this
change.

* docs: add features to the docs

* docs: document TAGS and FEATURES as variables affecting the build

* fix: update tag in docs

* docs: include default value for features

* chore: move SKIP_SCENARIOS next to related

* docs: explain that SKIP is added to the TAGS variable

* fix: typo

* chore: grammar in docs

Co-authored-by: cachedout <[email protected]>

Co-authored-by: cachedout <[email protected]>
Co-authored-by: Adam Stokes <[email protected]>
(cherry picked from commit 888ecfe)
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request May 26, 2021
* master:
  feat: support for running feature files (elastic#1193)
adam-stokes pushed a commit that referenced this pull request May 27, 2021
* chore: update unit tests docs in PR template

* docs: document configurations location

* docs: document how the CI spreads feature files and tags

* chore: extract build logic to commons

* chore: create build scripts per test suite

This way each test suite will control its own life cycle

* chore: update scripts used by CI

* chore: remove extracted code from the original makefile

* chore: remove unused variables in makefile

* docs: update how to use the make goals

* fix: move build-docs back to the original makefile

* chore: move lint back to the original makefile

* feat: support passing feature file to the test runner

It will accept the file name of a feature file, otherwise, it will run
all feature files under the 'features/' directory, as it did before this
change.

* docs: add features to the docs

* docs: document TAGS and FEATURES as variables affecting the build

* fix: update tag in docs

* docs: include default value for features

* chore: move SKIP_SCENARIOS next to related

* docs: explain that SKIP is added to the TAGS variable

* fix: typo

* chore: grammar in docs

Co-authored-by: cachedout <[email protected]>

Co-authored-by: cachedout <[email protected]>
Co-authored-by: Adam Stokes <[email protected]>
(cherry picked from commit 888ecfe)

Co-authored-by: Manuel de la Peña <[email protected]>
adam-stokes pushed a commit that referenced this pull request May 27, 2021
* chore: update unit tests docs in PR template

* docs: document configurations location

* docs: document how the CI spreads feature files and tags

* chore: extract build logic to commons

* chore: create build scripts per test suite

This way each test suite will control its own life cycle

* chore: update scripts used by CI

* chore: remove extracted code from the original makefile

* chore: remove unused variables in makefile

* docs: update how to use the make goals

* fix: move build-docs back to the original makefile

* chore: move lint back to the original makefile

* feat: support passing feature file to the test runner

It will accept the file name of a feature file, otherwise, it will run
all feature files under the 'features/' directory, as it did before this
change.

* docs: add features to the docs

* docs: document TAGS and FEATURES as variables affecting the build

* fix: update tag in docs

* docs: include default value for features

* chore: move SKIP_SCENARIOS next to related

* docs: explain that SKIP is added to the TAGS variable

* fix: typo

* chore: grammar in docs

Co-authored-by: cachedout <[email protected]>

Co-authored-by: cachedout <[email protected]>
Co-authored-by: Adam Stokes <[email protected]>
(cherry picked from commit 888ecfe)

Co-authored-by: Manuel de la Peña <[email protected]>
@mdelapenya mdelapenya deleted the 1191-support-running-features branch June 2, 2021 05:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants