Skip to content

Commit d0a58ac

Browse files
committed
Merge branch 'master' into stable
2 parents a69ab75 + abee739 commit d0a58ac

8 files changed

+535
-131
lines changed

.github/CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This should match the owning team set up in https://github.com/orgs/wazuh/teams
2+
* @wazuh/frontend
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
Introduction
2+
3+
## Footprint metrics information
4+
| | |
5+
|--------------------------------------|---|
6+
| **Main release candidate issue** | |
7+
| **Version** | |
8+
| **Release candidate #** | |
9+
| **Tag** | |
10+
| **Previous python unit tests issue** | - |
11+
12+
## Test report procedure
13+
All individual test checks must be marked as:
14+
| | |
15+
|-------|------------------------------------------------------------------------------------------------------|
16+
| Pass | The test ran successfully. |
17+
| Xfail | The test was expected to fail and it failed. It must be properly justified and reported in an issue. |
18+
| Skip | The test was not run. It must be properly justified and reported in an issue. |
19+
| Fail | The test failed. A new issue must be opened to evaluate and address the problem. |
20+
21+
22+
All test results must have one the following statuses:
23+
| | |
24+
|-----------------|----------------------------------------------------------------------|
25+
| :green_circle: | All checks passed. |
26+
| :red_circle: | There is at least one failed check. |
27+
| :yellow_circle: | There is at least one expected fail or skipped test and no failures. |
28+
29+
30+
Any failing test must be properly addressed with a new issue, detailing the error and the possible cause. It must be included in the `Fixes` section of the current release candidate main issue.
31+
32+
Any expected fail or skipped test must have an issue justifying the reason. All auditors must validate the justification for an expected fail or skipped test.
33+
34+
An extended report of the test results must be attached as a zip or txt. This report can be used by the auditors to dig deeper into any possible failures and details.
35+
36+
As for the coverage results, they must be added split by modules. Test files must not be included in the coverage report.
37+
38+
All test coverage results must have one of the following statuses:
39+
40+
## Checks
41+
| Status | Coverage | Modules | Version |
42+
|----------------|----------------|----------------|---------|
43+
| :green_square: | :green_square: | :green_square: | All |
44+
45+
| | |
46+
|-----------------|--------|
47+
| :green_square: | >= 75% |
48+
| :yellow_square: | >= 50% |
49+
| :orange_square: | >= 25% |
50+
| :red_square: | < 25% |
51+
52+
53+
## Conclusions
54+
55+
All tests have been executed and the results can be found here.
56+
<!--
57+
| | | | |
58+
|----------------|-------------|---------------------|----------------|
59+
| **Status** | **Test** | **Failure type** | **Notes** |
60+
| | | | |
61+
-->
62+
63+
All tests have passed and the fails have been reported or justified. I therefore conclude that this issue is finished and OK for this release candidate.
64+
65+
66+
## Auditors validation
67+
The definition of done for this one is the validation of the conclusions and the test results from all auditors.
68+
69+
All checks from below must be accepted in order to close this issue.
70+
71+
- [x]
72+
- [x]
73+
- [x]
74+
75+
76+

.github/workflows/backport.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
backport:
1010
name: Backport
11-
runs-on: ubuntu-18.04
11+
runs-on: ubuntu-latest
1212
# Only react to merged PRs for security reasons.
1313
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
1414
if: >

.github/workflows/cypress-automation-tests.yml

-130
This file was deleted.

.github/workflows/cypress-basic.yml

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# This is a basic workflow that is manually triggered
2+
3+
name: Cypress automation test - [basic]
4+
5+
# Controls when the action will run. Workflow runs when manually triggered using the UI
6+
# or API.
7+
on:
8+
workflow_dispatch:
9+
# Inputs the workflow accepts.
10+
inputs:
11+
wazuh-version:
12+
description: 'Wazuh Version'
13+
default: 'v4.3.4'
14+
required: true
15+
elastic-version:
16+
description: 'Elastic Version'
17+
default: '7.16.3'
18+
required: true
19+
ubuntu-cypress-version:
20+
description: 'Ubuntu Cypress Version'
21+
default: '3.0.0'
22+
required: true
23+
url-package:
24+
description: 'Package Download Url'
25+
required: false
26+
default: 'https://packages-dev.wazuh.com/pre-release/ui/kibana/wazuh_kibana-4.3.4_7.16.3-1.zip'
27+
28+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
29+
jobs:
30+
setup-wazuh-kibana-app:
31+
name: Run setup environment wazuh kibana app
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Step 01 - Set up environment variables
35+
run: |
36+
echo "PATH_TEMPLATE=$GITHUB_WORKSPACE/wazuh-app-environments/templates_elastic_prod/es_basic-wz_cluster-agent/" >> $GITHUB_ENV
37+
38+
echo "Information about the workflow (basic):
39+
wazuh-version: ${{ github.event.inputs.wazuh-version }}
40+
elastic-version: ${{ github.event.inputs.elastic-version }}
41+
ubuntu-cypress-version: ${{ github.event.inputs.ubuntu-cypress-version }}
42+
url-package: ${{ github.event.inputs.url-package }}"
43+
44+
- name: Step 02 - Download Project wazuh-app-environments
45+
uses: actions/checkout@v2
46+
with:
47+
repository: matiasmoreno876/wazuh-app-environments
48+
ref: 'master'
49+
path: wazuh-app-environments
50+
token: ${{ secrets.FE_SECRET_TOKEN }}
51+
- name: Step 03 - Configuring templates docker environment
52+
run: |
53+
cd $GITHUB_WORKSPACE/wazuh-app-environments/
54+
mkdir packages
55+
cd ${{ env.PATH_TEMPLATE }}
56+
sed -i -e 's|WAZUH_VERSION=.*|WAZUH_VERSION=${{ github.event.inputs.wazuh-version }}|g' ./.env
57+
sed -i -e 's|ELASTIC_VERSION=.*|ELASTIC_VERSION=${{ github.event.inputs.elastic-version }}|g' ./.env
58+
sed -i -e 's|UBUNTU_CYPRESS_VERSION=.*|UBUNTU_CYPRESS_VERSION=${{ github.event.inputs.ubuntu-cypress-version }}|g' ./.env
59+
cat .env
60+
- name: Step 04 - Starting containers
61+
run: |
62+
cd ${{ env.PATH_TEMPLATE }}
63+
docker-compose up -d
64+
echo CONTINUES AFTER 15 SECONDS ...
65+
sleep 15s
66+
- name: Step 05 - Installing package from url
67+
run: |
68+
cd ${{ env.PATH_TEMPLATE }}
69+
docker exec $(docker-compose ps -q kibana) bin/kibana-plugin install ${{ github.event.inputs.url-package }}
70+
docker-compose restart kibana
71+
echo CONTINUES AFTER 60 SECONDS ...
72+
sleep 60s
73+
docker-compose ps
74+
- name: Step 06 - Configuring ip container into wazuh.yml
75+
run: |
76+
cd ${{ env.PATH_TEMPLATE }}
77+
docker exec $(docker-compose ps -q kibana) sed -i -e "s/url: https:\/\/localhost/url: https:\/\/wazuh-manager-master/g" /usr/share/kibana/data/wazuh/config/wazuh.yml
78+
docker exec $(docker-compose ps -q kibana) cat /usr/share/kibana/data/wazuh/config/wazuh.yml
79+
- name: Step 07 - Run Cypress tests
80+
id: run-cypress-test
81+
run: |
82+
cd ${{ env.PATH_TEMPLATE }}
83+
docker exec $(docker-compose ps -q cypress) bash -c " . /home/automation/nvm/nvm.sh && nvm use && npm run cypress:run-headless:github-actions:basic" | tee cypress.log
84+
continue-on-error: true
85+
- name: Step 08 - Run Cypress reports
86+
run: |
87+
cd ${{ env.PATH_TEMPLATE }}
88+
docker exec $(docker-compose ps -q cypress) bash -c " . /home/automation/nvm/nvm.sh && nvm use && npm run cypress:report"
89+
- name: Step 09 - Archive reports
90+
uses: actions/upload-artifact@v2
91+
with:
92+
name: cypress-reports_BASIC_${{ github.event.inputs.wazuh-version }}-${{ github.event.inputs.elastic-version }}
93+
path: ${{ env.PATH_TEMPLATE }}/report/*
94+
- name: Step 10 - Log parsing
95+
run: |
96+
cd ${{ env.PATH_TEMPLATE }}
97+
echo "TEST_SKIPPED=$(grep -E "failed \(|passed" cypress.log | awk ' { print $(NF)}')" >> $GITHUB_ENV
98+
echo "TEST_PENDING=$(grep -E "failed \(|passed" cypress.log | awk ' { print $(NF-1)}')" >> $GITHUB_ENV
99+
echo "TEST_FAILING=$(grep -E "failed \(|passed" cypress.log | awk ' { print $(NF-2)}')" >> $GITHUB_ENV
100+
echo "TEST_PASSING=$(grep -E "failed \(|passed" cypress.log | awk ' { print $(NF-3)}')" >> $GITHUB_ENV
101+
echo "TEST_TOTAL=$(grep -E "failed \(|passed" cypress.log | awk ' { print $(NF-4)}')" >> $GITHUB_ENV
102+
echo "TEST_TIME=$(grep -E "failed \(|passed" cypress.log | awk ' { print $(NF-5)}')" >> $GITHUB_ENV
103+
- name: Step 11 - Post to a Slack channel
104+
id: slack
105+
uses: slackapi/slack-github-action@v1.19.0
106+
with:
107+
# Slack channel id, channel name, or user id to post message.
108+
# See also: https://api.slack.com/methods/chat.postMessage#channels
109+
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
110+
# For posting a simple plain text message
111+
slack-message: "The following workflow was executed: ${{ github.workflow }}\nWazuh version: ${{ github.event.inputs.wazuh-version }}\nElastic version: ${{ github.event.inputs.elastic-version }}\nUbuntu Cypress version: ${{ github.event.inputs.ubuntu-cypress-version }}\nPackage used: ${{ github.event.inputs.url-package }}\n\nTest summary:\n\tTotal Test: ${{ env.TEST_TOTAL }}\n\tPassing: ${{ env.TEST_PASSING }}\n\tFailing: ${{ env.TEST_FAILING }}\n\tPending: ${{ env.TEST_PENDING }}\n\tSkipped: ${{ env.TEST_SKIPPED }}\n\tTotal Time: ${{ env.TEST_TIME }}\n\nFor more information visit: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
112+
env:
113+
SLACK_BOT_TOKEN: ${{ secrets.ACTIONS_SLACK_TOKEN }}

0 commit comments

Comments
 (0)