-
Notifications
You must be signed in to change notification settings - Fork 42
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
Integration of basic functional test suite developed with FTR into the Create Environment workflow #2219
Conversation
This pull request does not have a backport label. Could you fix it @gurevichdmitry? 🙏
|
📊 Allure Report - 💚 No failures were reported.
|
run-ui-sanity-tests: | ||
description: "Run UI sanity tests after provision" | ||
default: false | ||
type: boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a new input parameter to provide flexibility in selecting which tests to execute. This can also be combined with a checkbox to run both integration sanity checks and UI sanity checks.
es_version: ${{ env.STACK_VERSION }} | ||
ref_commit_sha: ${{ inputs.ref_commit_sha }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version control for Kibana UI tests has become relevant because the UI controls implementation can differ between versions. Currently, I assume that the user executing the workflow will select the correct Kibana version and branch, for example, 8.15.0-SNAPSHOT
and main
, or in the future 8.15.0
and v8.15.0
in Kibana.
I am considering whether we should implement logic to prevent execution if versions do not match correctly. In the current create environment workflow, we allow installing different versions, so we need to decide if we should add additional logic to enforce version consistency, or if we will simply allow the UI tests to fail if an incorrect branch/tag is provided.
dev-docs/Cloud-Env-Testing.md
Outdated
@@ -45,6 +45,10 @@ Follow these steps to run the workflow: | |||
|
|||
- **`run-sanity-tests`** (**optional**): Set to `true` to run sanity tests after the environment is set up. Default: `false` | |||
|
|||
- **`run-ui-sanity-tests`** (**optional**): Set to `true` to run Kibana UI sanity tests after the environment is set up. Default: `false` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe link the tests docs here (.github/actions/kibana-ftr/README.md)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linked to the kibana-ftr
action documentation
dev-docs/Cloud-Env-Testing.md
Outdated
@@ -45,6 +45,10 @@ Follow these steps to run the workflow: | |||
|
|||
- **`run-sanity-tests`** (**optional**): Set to `true` to run sanity tests after the environment is set up. Default: `false` | |||
|
|||
- **`run-ui-sanity-tests`** (**optional**): Set to `true` to run Kibana UI sanity tests after the environment is set up. Default: `false` | |||
|
|||
- **`ref_commit_sha`** (**optional**): Specifies the Kibana branch, tag, or commit SHA to check out for the UI sanity tests, which will be executed after the environment is set up. This should correspond to the version of the `elk-stack-version` provisioned by this workflow. Note that for the current version in development, use Kibana's `main` branch. Default: `main` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
field name is too generic IMO, consider making it more clear that it's Kibana's commit, e.g. kbn_ref_commit_sha
, also since it's not referring only the commit sha, but also the branch name, maybe more generic on that side, so kibana_ref
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to kibana_ref
export CSPM_PUBLIC_IP=$(terraform output -raw ec2_cspm_public_ip) | ||
echo "::add-mask::$CSPM_PUBLIC_IP" | ||
echo "CSPM_PUBLIC_IP=$CSPM_PUBLIC_IP" >> $GITHUB_ENV | ||
run: ../../.ci/scripts/set_environment_output.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a generic script that will be used in other workflows? If not, I would use a less generic name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed to set_cloud_env_params
dev-docs/Cloud-Env-Testing.md
Outdated
@@ -45,6 +45,10 @@ Follow these steps to run the workflow: | |||
|
|||
- **`run-sanity-tests`** (**optional**): Set to `true` to run sanity tests after the environment is set up. Default: `false` | |||
|
|||
- **`run-ui-sanity-tests`** (**optional**): Set to `true` to run Kibana UI sanity tests after the environment is set up. Default: `false` | |||
|
|||
- **`ref_commit_sha`** (**optional**): Specifies the Kibana branch, tag, or commit SHA to check out for the UI sanity tests, which will be executed after the environment is set up. This should correspond to the version of the `elk-stack-version` provisioned by this workflow. Note that for the current version in development, use Kibana's `main` branch. Default: `main` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add example supported values for each option? Just to make sure the format is clear for users
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added examples for branch
, tag
and commit SHA
.
.github/actions/kibana-ftr/README.md
Outdated
ref_commit_sha: ${{ github.event.inputs.ref_commit_sha || 'main' }} | ||
test_kibana_url: ${{ secrets.TEST_KIBANA_URL }} # required | ||
test_es_url: ${{ secrets.TEST_ES_URL }} # required | ||
es_version: 8.15.0-SNAPSHOT # required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this hard-coded? Or is it only for the example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
es_version
in the README is just an example.
.github/actions/kibana-ftr/README.md
Outdated
test_kibana_url: ${{ secrets.TEST_KIBANA_URL }} # required | ||
test_es_url: ${{ secrets.TEST_ES_URL }} # required | ||
es_version: 8.15.0-SNAPSHOT # required | ||
test_browser_headless: '1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we using '1'
as a boolean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This originates from the FTR runner, where setting the environment variable to '1' activates headless mode. However, as per @orouz's suggestion, I'll eliminate this input variable. Since all tests are executed in headless mode on the CI, no further adjustments are necessary.
This is the latest run after addressing review comments. |
Summary of your changes
This PR adds the ability to run test suites written in the
Kibana
repository using theFunctional Test Runner
(FTR). The integration is achieved through theCreate Environment
workflow. When the UI sanity check option is selected, theCreate Environment
workflow will execute UI sanity checks from theKibana
repository. Themain
branch ofKibana
will be used for checkout.Running Kibana tests using FTR was implemented as a separate
GitHub
actionkibana-ftr
, which is reused in theCreate Environment
workflow. This action checks out the specified Kibana branch without history, then installs necessary tools and performs a bootstrap. After preparation, FTR is executed with the specified configuration.Screenshot/Data
This PR introduces two input parameters for the Create Environment workflow:
run-ui-sanity-tests
flag, which allows you to select whether to run UI sanity tests, andref_commit_sha
, which allows you to choose the appropriate Kibana branch, tag, or commit SHA.New Step in the workflow
![Screenshot 2024-05-22 at 14 44 25](https://private-user-images.githubusercontent.com/99176494/332782832-7372fcf9-b346-40b3-987a-5ed5cdfc59c8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTk1NTMsIm5iZiI6MTczOTI1OTI1MywicGF0aCI6Ii85OTE3NjQ5NC8zMzI3ODI4MzItNzM3MmZjZjktYjM0Ni00MGIzLTk4N2EtNWVkNWNkZmM1OWM4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA3MzQxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJmZTQxNzFjYTViY2U0NmY3NjIwODZjYjZhYTcyM2JlYzA3ZWI0NzZkMzAyNDcxOWM3MDBlY2E5ZDRmNmJlZmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.K3BIVS5PDbkPGXVTcvU2kYW8QzMcH3ex3x2nFJcZfBI)
Report Example
![Screenshot 2024-05-22 at 14 45 27](https://private-user-images.githubusercontent.com/99176494/332783142-f603808b-6b3d-4575-b0dd-2e9e3982c4f7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTk1NTMsIm5iZiI6MTczOTI1OTI1MywicGF0aCI6Ii85OTE3NjQ5NC8zMzI3ODMxNDItZjYwMzgwOGItNmIzZC00NTc1LWIwZGQtMmU5ZTM5ODJjNGY3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA3MzQxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBlZmQzY2ZjYzQ1N2MyZDA5NWNiZWNiZTkzMDNmNzY4NjlkYmQwYzM1NzEwMGYxZmM3ZDdkNjBiMDc5NzljMTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.q9MD3YXpMhwzyNb9L_EG3p76oENSym7cOR0hdXxqwtE)
Related Issues
Checklist
Introducing a new rule?