Skip to content

Commit

Permalink
Merge pull request #99 from PrestaShop/develop
Browse files Browse the repository at this point in the history
Merge `develop` into `master`
  • Loading branch information
Progi1984 authored Jan 12, 2024
2 parents 2b1ef8c + b277bcf commit c1940f3
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 228 deletions.
4 changes: 0 additions & 4 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots

DATABASE_URL="mysql://root:[email protected]:3306/qanightlyresults?serverVersion=8.0.23&charset=utf8mb4"

QANB_GCPURL=https://storage.googleapis.com/prestashop-core-nightly/
QANB_TOKEN='AZERTY'
10 changes: 6 additions & 4 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,20 @@ jobs:
- name: Inject data for AutoUpgrade
run: |
DATE=$(date -d "2 days ago" +"%Y-%m-%d")
php bin/console nightly:import autoupgrade_$DATE-develop.json\
php bin/console nightly:import \
-p cli \
-c autoupgrade \
--env test
--env test \
autoupgrade_$DATE-develop.json
- name: Inject data for Core
run: |
DATE=$(date -d "2 days ago" +"%Y-%m-%d")
php bin/console nightly:import $DATE-develop.json\
php bin/console nightly:import \
-p chromium \
-c functional \
--env test
--env test \
$DATE-develop.json
- name: Run phpunit
run: ./vendor/bin/phpunit
11 changes: 5 additions & 6 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

ini_set('memory_limit','256M');

$finder = PhpCsFixer\Finder::create()->in([
__DIR__.'/src',
__DIR__.'/migrations',
__DIR__.'/public',
__DIR__.'/tests',
]);
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude([
'var',
]);

return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ RUN mv /var/www/html/vhost.conf /etc/apache2/sites-enabled/000-default.conf && \
a2enmod proxy_http && \
a2enmod headers

RUN sed -i 's/^max_execution_time = .*/max_execution_time = 300/' /usr/local/etc/php/php.ini-production && \
RUN sed -i 's/^max_execution_time = .*/max_execution_time = 3600/' /usr/local/etc/php/php.ini-production && \
sed -i 's/variables_order = "GPCS"/variables_order = "EGPCS"/' /usr/local/etc/php/php.ini-production && \
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
35 changes: 13 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,30 @@ Its purpose is to :
2. let people browse a report of a test execution
3. display some statistics about test failures

## Usage

Create a database following the schema provided in schema.sql at the root of the project.

Don't forget to launch `composer install` to install all dependencies.

### Configuration

You can create a `.env.local` file at the root of the project.
You can create a `.env.local` file at the root of the project. You can also pass the values via environment variables.

### Configuration
Here are the main ones:

You can edit the `settings.php` file in the `src/` folder (no recommended). You can also pass the values via environment variables. Here are the main ones:

|Variables | |
|-------------------|---|
| QANB_ENV | Environment (will display errors only if set to `staging` or `testing`) |
| QANB_DB_HOST | Database host address |
| QANB_DB_USERNAME | Database username |
| QANB_DB_PASSWORD | Database password |
| QANB_DB_NAME | Database name |
| Variables | |
|-------------------|------------------------------------------|
| DATABASE_URL | DSN for MySQL Server |
| QANB_TOKEN | Token to add JSON data through the Hook |
| QANB_GCPURL | URL to the GCP repository (must ends with a `/`) |

## Usage

Install dependencies with a `composer install`.

Create a database with a `php bin/console doctrine:schema:update --dump-sql --force`.

## Web server configuration

Set up a vhost that points to the `/public` folder (example in the `vhost.conf` file).

## Inserting new data

Use the hook provided in the `Hook` controller. You need to call this URL: `BASE_URL/hook/add` with the following GET
Use the hook provided in the `Hook` controller. You need to call this URL: `BASE_URL/hook/reports/import` with the following GET
parameters:
- `token`: the token set in the environment variable `QANB_TOKEN` (e.g.: `IpBzOmwXQUrW5Hn`)
- `filename` : the complete filename to look for in the Google Cloud Storage (e.g.: `2019-07-22-develop.json`). The
Expand All @@ -51,12 +43,11 @@ Optional:
- `browser`: to specify the browser. Possible values are 'chromium' (default), 'firefox', and 'edge'.
- `campaign`: to specify the campaign. Possible values are 'functional' (default), 'sanity', 'e2e', and 'regression'.

EG : `api.mysite.com/hook/add?token=IpBzOmwXQUrW5Hn&filename=2019-07-22-develop.json`
EG : `api.mysite.com/hook/reports/import?token=IpBzOmwXQUrW5Hn&filename=2019-07-22-develop.json`

The files in the Google Cloud Storage might be huge, so be sure your server is properly configured to handle large files.

Files will be taken from `https://storage.googleapis.com/prestashop-core-nightly/reports/` (unless specified otherwise
in the environment variable `QANB_GCPURL`).
Files will be taken from `https://storage.googleapis.com/prestashop-core-nightly/reports/`.


## Containers
Expand Down
4 changes: 2 additions & 2 deletions config/preload.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
if (file_exists(dirname(__DIR__) . '/var/cache/prod/App_KernelProdContainer.preload.php')) {
require dirname(__DIR__) . '/var/cache/prod/App_KernelProdContainer.preload.php';
}
4 changes: 1 addition & 3 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
parameters:
env(QANB_GCPURL): 'https://storage.googleapis.com/prestashop-core-nightly/'
QANB_GCPURL: '%env(QANB_GCPURL)%'
QANB_GCPURL: 'https://storage.googleapis.com/prestashop-core-nightly/'
QANB_TOKEN: '%env(QANB_TOKEN)%'
DATABASE_URL: '%env(resolve:DATABASE_URL)%'

services:
# default configuration for services in *this* file
Expand Down
9 changes: 0 additions & 9 deletions dbUpgrade.sh

This file was deleted.

7 changes: 2 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@ services:
ports:
- "80:80"
environment:
QANB_BASEURL: "localhost"
QANB_DB_HOST: "localhost"
QANB_DB_USERNAME: "myDBUser"
QANB_DB_PASSWORD: "myDBPasswd"
QANB_DB_NAME: "myDBName"
DATABASE_URL: "mysql://myDBUser:[email protected]:3306/myDBName?serverVersion=myDBServer&charset=utf8mb4"
QANB_TOKEN: "myAPIToken"
154 changes: 0 additions & 154 deletions schema.sql

This file was deleted.

Loading

0 comments on commit c1940f3

Please sign in to comment.