-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MetricsPower] Added unit and feature tests
- Loading branch information
1 parent
c86ed0f
commit b9f183f
Showing
44 changed files
with
1,332 additions
and
850 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# In all environments, the following files are loaded if they exist, | ||
# the later taking precedence over the former: | ||
# | ||
# * .env contains default values for the environment variables needed by the app | ||
# * .env.local uncommitted file with local overrides | ||
# * .env.$APP_ENV committed environment-specific defaults | ||
# * .env.$APP_ENV.local uncommitted environment-specific overrides | ||
# | ||
# Real environment variables win over .env files. | ||
# | ||
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES. | ||
# | ||
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2). | ||
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration | ||
|
||
###> sentry ### | ||
SENTRY_DSN=https://KEY@INSTANCE.ingest.us.sentry.io/NAMESPACE | ||
SENTRY_ENVIRONMENT=${APP_ENV} | ||
SENTRY_TRACES_SAMPLE_RATE=1.0 | ||
SENTRY_PROFILE_SAMPLE_RATE=1.0 | ||
###< sentry ### | ||
|
||
###> prometheus ### | ||
PROMETHEUS_NAMESPACE=project-name | ||
PROMETHEUS_STORAGE=in-memory | ||
PROMETHEUS_REDIS_HOST=redis | ||
PROMETHEUS_REDIS_PORT=6379 | ||
PROMETHEUS_REDIS_DATABASE=0 | ||
PROMETHEUS_REDIS_TIMEOUT=0.1 | ||
PROMETHEUS_REDIS_READ_TIMEOUT=10 | ||
PROMETHEUS_REDIS_PERSISTENT_CONNECTIONS=false | ||
PROMETHEUS_REDIS_PASSWORD=secret | ||
PROMETHEUS_REDIS_URL=redis://${PROMETHEUS_REDIS_PASSWORD}@${PROMETHEUS_REDIS_HOST} | ||
###< prometheus ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
- 'releases/**' | ||
paths-ignore: | ||
- '**/*.md' | ||
- '**/*.gitignore' | ||
- '**/*.gitattributes' | ||
|
||
pull_request: | ||
types: | ||
- published | ||
- created | ||
- edited | ||
- opened | ||
- synchronize | ||
- reopened | ||
paths-ignore: | ||
- '**/*.md' | ||
- '**/*.gitignore' | ||
- '**/*.gitattributes' | ||
|
||
jobs: | ||
build: | ||
name: PHP | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
php: | ||
- "8.1" | ||
- "8.2" | ||
- "8.3" | ||
include: | ||
- php-version: "8.1" | ||
composer-options: "--ignore-platform-reqs" | ||
- php-version: "8.2" | ||
composer-options: "--ignore-platform-reqs" | ||
- php-version: "8.3" | ||
composer-options: "--ignore-platform-reqs" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: "${{ matrix.php }}" | ||
extensions: mbstring, intl | ||
coverage: xdebug | ||
tools: pecl, phpunit, composer | ||
ini-values: post_max_size=256M | ||
|
||
- name: Setup composer | ||
uses: ramsey/composer-install@v1 | ||
with: | ||
composer-options: "${{ matrix.composer-options }}" | ||
|
||
- name: Validate composer files | ||
run: composer validate | ||
|
||
- name: Cache composer packages | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php- | ||
- name: Install dependencies | ||
if: steps.composer-cache.outputs.cache-hit != 'true' | ||
run: composer update --prefer-dist --no-progress | ||
|
||
- name: Setup tests directories | ||
run: mkdir -p build/logs | ||
|
||
- name: Execute unit tests | ||
run: ./vendor/bin/pest --colors=always --configuration phpunit.xml.dist --coverage-cobertura tests-cobertura.xml --coverage-clover tests-coverage.xml --log-junit tests-execution.xml | ||
|
||
- name: Prepare coverages and logs | ||
run: cp tests-coverage.xml build/logs/clover.xml && cp tests-cobertura.xml build/logs/cobertura.xml && cp tests-execution.xml build/logs/junit.xml | ||
|
||
- name: Push to Coveralls | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COVERALLS_PARALLEL: true | ||
COVERALLS_FLAG_NAME: php-${{ matrix.php-versions }} | ||
run: | | ||
composer global require php-coveralls/php-coveralls | ||
php-coveralls -v | ||
finish: | ||
needs: [ build ] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Coveralls Finished | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
parallel-finished: true | ||
|
||
sonarcloud: | ||
name: SonarCloud | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: SonarCloud Scan | ||
uses: SonarSource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 0 additions & 70 deletions
70
EventListener/Prometheus/AbstractMetricsWorkerEventSubscriber.php
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.