Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .github/workflows/csv-export-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: "CSV Export Functional Test"

on:
pull_request:
push:

permissions:
contents: read

jobs:
csv-export-test:
name: "CSV Export Functional Test - PHP ${{ matrix.php }} - Symfony ${{ matrix.symfony }}"
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: ['8.2']
symfony: ['6.4.*']

steps:
- name: "Checkout code"
uses: "actions/checkout@v4"

- name: "Cache Composer packages"
uses: "actions/cache@v4"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('composer.json') }}"
restore-keys: "php-"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php }}"
extensions: mbstring, intl
tools: "composer:v2"
coverage: none

- name: "Install dependencies"
run: "composer update --prefer-dist --no-progress --no-interaction"
env:
SYMFONY_REQUIRE: "${{ matrix.symfony }}"

- name: "Verify mock data fixture exists"
run: |
if [ ! -f tests/Fixtures/mock-properties.json ]; then
echo "Error: Mock data file not found!"
exit 1
fi
echo "Mock data file found:"
cat tests/Fixtures/mock-properties.json | head -20

- name: "Run CSV Export Functional Test"
run: "vendor/bin/simple-phpunit tests/Functional/CsvExportFunctionalTest.php --testdox"

- name: "Install hyperfine for performance testing"
run: |
wget https://github.com/sharkdp/hyperfine/releases/download/v1.18.0/hyperfine_1.18.0_amd64.deb
sudo dpkg -i hyperfine_1.18.0_amd64.deb
hyperfine --version

- name: "Install Rust toolchain for generator compilation"
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable

- name: "Compile C and Rust generators"
run: |
cd tests/Scripts
make all
echo "✓ C and Rust generators compiled successfully"

- name: "Run Generator Performance Comparison"
run: |
echo "Comparing PHP, C, and Rust JSON generators..."
bash tests/Scripts/compare-generators.sh

- name: "Run Performance Benchmarks"
run: |
echo "Running CSV export performance benchmarks..."
bash tests/Scripts/benchmark-performance.sh

- name: "Display test summary"
if: always()
run: |
echo "=========================================="
echo "CSV Export Functional Test Complete"
echo "=========================================="
echo "Test validates that the Poliris bundle correctly:"
echo " ✓ Loads mock real estate property data"
echo " ✓ Generates CSV files in Poliris format"
echo " ✓ Includes all expected fields and values"
echo " ✓ Uses correct CSV structure and delimiters"
echo "=========================================="
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"symfony/framework-bundle": "^5.4|^6.0|^7.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^5.4|^6.0|^7.0"
"symfony/phpunit-bridge": "^5.4|^6.0|^7.0",
"symfony/property-access": "*"
},
"config": {
"allow-plugins": {
Expand Down
153 changes: 153 additions & 0 deletions tests/Fixtures/mock-properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
[
{
"identifiant": {
"agenceId": "AGENCY001",
"agencePropertyRef": "REF-HOUSE-001",
"annonceType": "vente",
"annonceIdTechnique": "TECH-ID-001"
},
"type": {
"type": "Maison",
"sousType": "Villa"
},
"localisation": {
"ville": "Paris",
"codePostal": "75001",
"pays": "France",
"adresse": "10 Rue de la Paix",
"latitude": 48.8566,
"longitude": 2.3522,
"proximite": "Proche métro et commerces"
},
"prix": {
"prix": 750000,
"mentionPrix": "FAI"
},
"surface": {
"habitable": 150,
"terrain": 200
},
"contact": {
"nom": "Jean Dupont",
"telephone": "0123456789",
"email": "contact@agency.com",
"siteWeb": "www.agency.com"
},
"detail": {
"activitesCommerciales": "Belle maison familiale avec jardin",
"description": "Superbe villa moderne avec 5 chambres spacieuses, grand salon lumineux, cuisine équipée, garage double. Jardin paysager de 200m2."
},
"photos": [
"https://example.com/photos/house1-1.jpg",
"https://example.com/photos/house1-2.jpg",
"https://example.com/photos/house1-3.jpg"
],
"photosTitres": [
"Vue extérieure",
"Salon",
"Cuisine"
]
},
{
"identifiant": {
"agenceId": "AGENCY001",
"agencePropertyRef": "REF-APT-002",
"annonceType": "location",
"annonceIdTechnique": "TECH-ID-002"
},
"type": {
"type": "Appartement",
"sousType": "T3"
},
"localisation": {
"ville": "Lyon",
"codePostal": "69002",
"pays": "France",
"adresse": "25 Boulevard de la Croix-Rousse",
"complement": "Bâtiment A",
"quartier": "Croix-Rousse",
"proximite": "Métro ligne A",
"latitude": 45.7640,
"longitude": 4.8357
},
"prix": {
"prix": 1200,
"mentionPrix": "CC",
"complement": "Charges: 100€"
},
"surface": {
"habitable": 75,
"sejour": 25,
"terrasse": 10,
"hauteur": 2.8,
"balcon": 5
},
"contact": {
"nom": "Marie Martin",
"telephone": "0987654321",
"email": "location@agency.com",
"siteWeb": "www.agency.com"
},
"detail": {
"activitesCommerciales": "Appartement T3 moderne",
"description": "Bel appartement de 75m2 avec 2 chambres, salon lumineux, cuisine américaine équipée, terrasse. Vue imprenable sur Lyon."
},
"photos": [
"https://example.com/photos/apt2-1.jpg",
"https://example.com/photos/apt2-2.jpg"
],
"photosTitres": [
"Vue générale",
"Terrasse"
],
"location": {
"loyerMensuel": 1200,
"charges": 100
}
},
{
"identifiant": {
"agenceId": "AGENCY002",
"agencePropertyRef": "REF-LAND-003",
"annonceType": "vente",
"annonceIdTechnique": "TECH-ID-003"
},
"type": {
"type": "Terrain",
"sousType": "Constructible"
},
"localisation": {
"ville": "Bordeaux",
"codePostal": "33000",
"pays": "France",
"adresse": "Avenue des Champs",
"quartier": "Caudéran",
"proximite": "Proche écoles",
"latitude": 44.8378,
"longitude": -0.5792
},
"prix": {
"prix": 180000,
"mentionPrix": "Net vendeur"
},
"surface": {
"terrain": 800
},
"contact": {
"nom": "Pierre Dubois",
"telephone": "0156789012",
"email": "vente@agency2.com",
"siteWeb": "www.agency2.com"
},
"detail": {
"activitesCommerciales": "Terrain à bâtir",
"description": "Magnifique terrain constructible de 800m2, viabilisé, COS 0.4. Libre de constructeur."
},
"terrain": {
"surface": 800,
"constructible": true,
"viabilise": true,
"cos": 0.4
}
}
]
Loading
Loading