Run test on CI
Prerequisites
- you need to DOWNLOAD or build a single executable file (plus some additional files which come together) for PMetrium Native of the target OS, for more details please follow this link
- CI Runner have a network access to the InfluxDB host
- you have up and run Grafana Dashboard for metrics visualization
- you have a CI runner with the physical connection to real devices
caution
PMetrium Native does not provide an out-of-the-box device farm ready for performance tests as this farm looks almost the same as for functional tests. So here we expect that on CI you already have such a runner for functional tests
- [ Optional ] runner has available
curl
on CLI
CI Runner settings
Copy a .tar.gz archive with single executable file for PMetrium Native (plus some additional files which come together) to the runner Workstation. Example with the
curl
:> curl -LJO https://github.com/parimatch-tech/PMetriumNative/raw/main/PackageRegistry/PMetriumNative.osx-arm64.v2.1.tar.gz
Where:
osx-arm64
- one of the target OS architectures. Available:win-x86
,win-x64
,win-arm
,win-arm64
,osx-x64
,osx-arm64
,linux-x64
,linux-arm
v2.0
- version of the ready build package, see the full list
Extract archive, open folder and run PMetrium Native server as a separate process on the runner. You may add some additional settings to it throught PMetrium Native config. For example:
> tar -xzf PMetriumNative.osx-arm64.v2.1.tar.gz --directory ./PMetriumNative.osx-arm64.v2.1
> cd ./PMetriumNative.osx-arm64.v2.1
> ./PMetrium.Native.Host && - move the process to the background on Linux-based runners
You may add PMetrium Native server to the startup of the runner OS
Execute health check of the PMetrium Native:
> curl http://localhost:7777/HealthCheck/Android
Or (depends on what platform you are going to test)
> curl http://localhost:7777/HealthCheck/IOS
The response should be just
OK
if everything is fine.
Run performance test
Now you just need to call PMetrium Native endpoint before functional test to start measurement and one endpoint after the test is finished, example for the CI:
> curl -G -d "device=192.168.0.103:5555" -d "applicationName=com.example.pmnative" http://localhost:7777/Android/Start
> dotnet test ./src/PMetrium.Native/FunctionalTests --filter ColdStart
> curl -G -d "device=192.168.0.103:5555" http://localhost:7777/Android/Stop
tip
You may handle the interaction with the PMetrium Native server from inside of the functional tests framework, in that case, it would be much easier to run tests, see the example