Skip to content

Centreon Monitoring Agent Windows robot test #307

Centreon Monitoring Agent Windows robot test

Centreon Monitoring Agent Windows robot test #307

name: Centreon Monitoring Agent Windows robot test
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
workflow_dispatch:
schedule:
- cron: '30 0 * * *'
jobs:
get-environment:
uses: ./.github/workflows/get-environment.yml
with:
version_file: CMakeLists.txt
build-collect:
needs: [get-environment]
uses: ./.github/workflows/package-collect.yml
with:
major_version: ${{ needs.get-environment.outputs.major_version }}
minor_version: ${{ needs.get-environment.outputs.minor_version }}
img_version: ${{ needs.get-environment.outputs.img_version }}
release: ${{ needs.get-environment.outputs.release }}
commit_hash: ${{ github.sha }}
stability: ${{ needs.get-environment.outputs.stability }}
legacy_engine: 'OFF'
build_debug_packages: false
packages_in_artifact: false
image: centreon-collect-debian-bullseye
distrib: bullseye
package_extension: deb
runner: collect
arch: amd64
is_nightly: ${{ needs.get-environment.outputs.is_nightly }}
secrets:
collect_s3_access_key: ${{ secrets.COLLECT_S3_ACCESS_KEY }}
collect_s3_secret_key: ${{ secrets.COLLECT_S3_SECRET_KEY }}
registry_username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
registry_password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
jira_base_url: ${{ secrets.JIRA_BASE_URL }}
jira_user_email: ${{ secrets.XRAY_JIRA_USER_EMAIL }}
jira_api_token: ${{ secrets.XRAY_JIRA_TOKEN }}
build-agent-and-execute-test:
needs: [build-collect]
runs-on: windows-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.COLLECT_S3_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.COLLECT_S3_SECRET_KEY }}
steps:
- name: nocrlf conversion
run: git config --system core.autocrlf false
- name: Checkout sources
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: distrib availables
run: wsl --list --online
- name: install debian
uses: Vampire/setup-wsl@v3
with:
distribution: Debian
use-cache: 'true'
update: 'true'
additional-packages:
mariadb-server
libmariadb3
librrd8
liblua5.3
python3
python3-pip
rrdtool
jq
- name: IP info
run: |
Write-Host "ip config"
ipconfig /all
Write-Host "ip address show"
wsl ip address show
- name: install robot framework
run: |
wsl pip3 install -U robotframework robotframework-databaselibrary robotframework-examples
wsl pip3 install pymysql python-dateutil grpcio grpcio_tools psutil
- name: Compile Agent
run: .github/scripts/windows-agent-compile.ps1
shell: powershell
- name: install database
run: |
$current_dir = (pwd).Path
$wsl_path = "/mnt/" + $current_dir.SubString(0,1).ToLower() + "/" + $current_dir.SubString(3).replace('\','/')
Write-Host "install mariadb"
wsl cd $wsl_path `&`& .github/scripts/collect-setup-database.sh
- name: Restore packages
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ./*.deb
key: ${{ github.run_id }}-${{ github.sha }}-deb-centreon-collect-bullseye-amd64-${{ github.head_ref || github.ref_name }}
fail-on-cache-miss: true
enableCrossOsArchive: true
- name: list packages
run: |
$current_dir = (pwd).Path
$wsl_path = "/mnt/" + $current_dir.SubString(0,1).ToLower() + "/" + $current_dir.SubString(3).replace('\','/')
wsl ls -l $wsl_path
- name: install collect packages
run: |
$current_dir = (pwd).Path
$wsl_path = "/mnt/" + $current_dir.SubString(0,1).ToLower() + "/" + $current_dir.SubString(3).replace('\','/')
wsl cd $wsl_path `&`& dpkg -i --force-all ./*.deb
- name: prepare robot tests
run: |
copy tests\resources\engine-scripts\echo.ps1 C:\Users\public\
copy tests\resources\engine-scripts\check.ps1 C:\Users\public\
- name: robot tests
run: .github/scripts/agent_robot_test.ps1
shell: powershell
- name: Upload Test Results
if: ${{ failure() }}
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: reports-cma-windows
path: reports
retention-days: 1