@@ -2,17 +2,17 @@ version: 2.1
2
2
3
3
orbs :
4
4
5
+
5
6
6
7
executors :
7
8
magento-executor :
8
9
machine :
9
10
image : ubuntu-2404:2024.11.1
10
11
docker_layer_caching : true
11
12
12
- jobs :
13
- magento-build :
14
- executor :
15
- name : magento-executor
13
+ commands :
14
+ setup-magento-environment :
15
+ description : " Setup Magento environment with common configuration"
16
16
parameters :
17
17
php-version :
18
18
type : string
@@ -32,13 +32,13 @@ jobs:
32
32
name : Setup folder structure and override file
33
33
command : |
34
34
mkdir ~/Sites
35
- mkdir ~/Sites/unit-tests
36
- mkdir ~/Sites/unit-coverage
37
35
cd ~/Sites
38
36
cat \<<EOF > compose.override.yml
39
37
services:
40
38
phpfpm:
41
39
image: markoshust/magento-php:<< parameters.php-version >>-fpm
40
+ db:
41
+ image: mariadb:10.11
42
42
EOF
43
43
- run :
44
44
name : Setup magento enterprise
64
64
command : |
65
65
bin/magento setup:di:compile
66
66
bin/magento module:status Algolia_AlgoliaSearch
67
+
68
+ jobs :
69
+ magento-build :
70
+ executor :
71
+ name : magento-executor
72
+ parameters :
73
+ php-version :
74
+ type : string
75
+ magento-version :
76
+ type : string
77
+ steps :
78
+ - setup-magento-environment :
79
+ php-version : << parameters.php-version >>
80
+ magento-version : << parameters.magento-version >>
81
+ - run :
82
+ name : Create test directories
83
+ command : |
84
+ mkdir ~/Sites/unit-tests
85
+ mkdir ~/Sites/unit-coverage
86
+ - persist_to_workspace :
87
+ root : ~/Sites
88
+ paths :
89
+ - .
67
90
- run :
68
91
name : Run Unit Tests and copy results to CircleCI
69
92
working_directory : ~/Sites
@@ -89,6 +112,65 @@ jobs:
89
112
path : ~/Sites/unit-coverage/report
90
113
destination : test-results/magento-<< parameters.magento-version >>-php-<< parameters.php-version >>
91
114
115
+ magento-integration-test :
116
+ executor :
117
+ name : magento-executor
118
+ parameters :
119
+ php-version :
120
+ type : string
121
+ magento-version :
122
+ type : string
123
+ steps :
124
+ - setup-magento-environment :
125
+ php-version : << parameters.php-version >>
126
+ magento-version : << parameters.magento-version >>
127
+ - run :
128
+ name : Configure integration tests
129
+ working_directory : ~/Sites
130
+ command : |
131
+ bin/cli cp dev/tests/integration/phpunit.xml.dist dev/tests/integration/phpunit.xml
132
+ - run :
133
+ name : Create integration test environment file
134
+ working_directory : ~/Sites
135
+ command : |
136
+
137
+ echo "MAGENTO_ADMIN_FIRST_NAME=john" >> .env
138
+ echo "MAGENTO_ADMIN_LAST_NAME=smith" >> .env
139
+ echo "MAGENTO_ADMIN_USER=john.smith" >> .env
140
+ echo "MAGENTO_ADMIN_PASSWORD=password123" >> .env
141
+ echo "MAGENTO_ADMIN_FRONTNAME=admin" >> .env
142
+ echo "MAGENTO_LOCALE=en_US" >> .env
143
+ echo "MAGENTO_CURRENCY=USD" >> .env
144
+ echo "MAGENTO_TIMEZONE=America/New_York" >> .env
145
+ echo "ALGOLIA_APPLICATION_ID=$ALGOLIA_APPLICATION_ID" >> .env
146
+ echo "ALGOLIA_SEARCH_KEY=$ALGOLIA_SEARCH_API_KEY" >> .env
147
+ echo "ALGOLIA_API_KEY=$ALGOLIA_API_KEY" >> .env
148
+ echo "INDEX_PREFIX=integration_test_" >> .env
149
+ docker cp .env $(docker compose ps -q phpfpm):/var/www/html/dev/tests/integration/.env
150
+ - run :
151
+ name : Prepare integration test environment
152
+ working_directory : ~/Sites
153
+ command : |
154
+ docker cp ../project/.circleci/install-config-mysql.php $(docker compose ps -q phpfpm):/var/www/html/dev/tests/integration/etc/install-config-mysql.php
155
+ bin/magento module:enable --all
156
+ bin/setup-integration-tests
157
+ - run :
158
+ name : Run Integration Tests
159
+ working_directory : ~/Sites
160
+ command : |
161
+ bin/cli bash -c "cd ./dev/tests/integration && export $(cat .env | xargs) && ../../../vendor/bin/phpunit --debug --exclude-group problematic ../../../vendor/algolia/algoliasearch-magento-2/Test/Integration/"
162
+
163
+ notify :
164
+ docker :
165
+ - image : cimg/base:current
166
+ steps :
167
+ - slack/notify :
168
+ event : fail
169
+ template : basic_fail_1
170
+ - slack/notify :
171
+ event : pass
172
+ template : success_tagged_deploy_1
173
+
92
174
workflows :
93
175
magento-build-and-test-workflow :
94
176
jobs :
@@ -97,3 +179,20 @@ workflows:
97
179
parameters :
98
180
php-version : ["8.2"]
99
181
magento-version : ["2.4.6-p11", "2.4.7-p6"]
182
+ - notify :
183
+ context : mage-slack
184
+ magento-integration-test-workflow :
185
+ when :
186
+ or :
187
+ - equal : [ main, << pipeline.git.branch >> ]
188
+ - matches :
189
+ pattern : " .*release.*"
190
+ value : << pipeline.git.branch >>
191
+ jobs :
192
+ - magento-integration-test :
193
+ matrix :
194
+ parameters :
195
+ php-version : ["8.2"]
196
+ magento-version : ["2.4.7-p6"]
197
+ - notify :
198
+ context : mage-slack
0 commit comments