jobs:
    test_back_catalogs_ee:
        machine:
            image: 'ubuntu-2004:2022.04.1'
            docker_layer_caching: true
        parameters:
            notify:
                type: boolean
                default: false
        steps:
            -   attach_workspace:
                    at: ~/
            -   load_docker_image_php
            -   fix_files_permissions
            -   start_test_containers
            -   run:
                    name: Lint back
                    command: PIM_CONTEXT=catalogs APP_ENV=test make catalogs-lint-back
            -   run:
                    name: Integration back
                    command: PIM_CONTEXT=catalogs APP_ENV=test EXPERIMENTAL_TEST_DATABASE=1 make catalogs-integration-back
            -   run:
                    name: Acceptance back
                    command: PIM_CONTEXT=catalogs APP_ENV=test make catalogs-acceptance-back
            -   when:
                    condition: << pipeline.parameters.run-database-tests >>
                    steps:
                        -   run:
                                name: Database schema reference
                                command: PIM_CONTEXT=test APP_ENV=test make test-database-structure
            -   when:
                    condition: << parameters.notify >>
                    steps:
                        -   slack-app/notify:
                                channel: 'monitoring-octopus'
                                event: fail
                                template: basic_fail_1
