@@ -9,10 +9,9 @@ executors:
9
9
image : ubuntu-2404:2024.11.1
10
10
docker_layer_caching : true
11
11
12
- jobs :
13
- magento-build :
14
- executor :
15
- name : magento-executor
12
+ commands :
13
+ setup-magento-environment :
14
+ description : " Setup Magento environment with common configuration"
16
15
parameters :
17
16
php-version :
18
17
type : string
32
31
name : Setup folder structure and override file
33
32
command : |
34
33
mkdir ~/Sites
35
- mkdir ~/Sites/unit-tests
36
- mkdir ~/Sites/unit-coverage
37
34
cd ~/Sites
38
35
cat \<<EOF > compose.override.yml
39
36
services:
64
61
command : |
65
62
bin/magento setup:di:compile
66
63
bin/magento module:status Algolia_AlgoliaSearch
64
+
65
+ jobs :
66
+ magento-build :
67
+ executor :
68
+ name : magento-executor
69
+ parameters :
70
+ php-version :
71
+ type : string
72
+ magento-version :
73
+ type : string
74
+ steps :
75
+ - setup-magento-environment :
76
+ php-version : << parameters.php-version >>
77
+ magento-version : << parameters.magento-version >>
78
+ - run :
79
+ name : Create test directories
80
+ command : |
81
+ mkdir ~/Sites/unit-tests
82
+ mkdir ~/Sites/unit-coverage
83
+ - persist_to_workspace :
84
+ root : ~/Sites
85
+ paths :
86
+ - .
67
87
- run :
68
88
name : Run Unit Tests and copy results to CircleCI
69
89
working_directory : ~/Sites
@@ -89,6 +109,55 @@ jobs:
89
109
path : ~/Sites/unit-coverage/report
90
110
destination : test-results/magento-<< parameters.magento-version >>-php-<< parameters.php-version >>
91
111
112
+ magento-integration-test :
113
+ executor :
114
+ name : magento-executor
115
+ parameters :
116
+ php-version :
117
+ type : string
118
+ magento-version :
119
+ type : string
120
+ steps :
121
+ - setup-magento-environment :
122
+ php-version : << parameters.php-version >>
123
+ magento-version : << parameters.magento-version >>
124
+ - run :
125
+ name : Configure integration tests
126
+ working_directory : ~/Sites
127
+ command : |
128
+ bin/cli dev/tests/integration/phpunit.xml.dist dev/tests/integration/phpunit.xml
129
+ - run :
130
+ name : Create integration test environment file
131
+ working_directory : ~/Sites
132
+ command : |
133
+ cat > dev/tests/integration/.env << 'EOF'
134
+
135
+ MAGENTO_ADMIN_FIRST_NAME=john
136
+ MAGENTO_ADMIN_LAST_NAME=smith
137
+ MAGENTO_ADMIN_USER=john.smith
138
+ MAGENTO_ADMIN_PASSWORD=password123
139
+ MAGENTO_ADMIN_FRONTNAME=admin
140
+ MAGENTO_LOCALE=en_US
141
+ MAGENTO_CURRENCY=USD
142
+ MAGENTO_TIMEZONE=America/New_York
143
+ ALGOLIA_APPLICATION_ID=TEST123
144
+ ALGOLIA_SEARCH_KEY_1=TEST123
145
+ ALGOLIA_API_KEY=TEST123
146
+ INDEX_PREFIX=TEST123
147
+ EOF
148
+ docker cp dev/tests/integration/.env $(docker compose ps -q phpfpm):/var/www/html/dev/tests/integration/.env
149
+ - run :
150
+ name : Apply environment variables
151
+ working_directory : ~/Sites
152
+ command : |
153
+ bin/cli cd ./dev/tests/integration
154
+ bin/cli export $(cat .env | xargs)
155
+ - run :
156
+ name : Run Integration Tests
157
+ working_directory : ~/Sites
158
+ command : |
159
+ bin/dev-test-run integration --debug /var/www/html/app/code/Algolia/AlgoliaSearch/Test/Integration/
160
+
92
161
workflows :
93
162
magento-build-and-test-workflow :
94
163
jobs :
@@ -97,3 +166,11 @@ workflows:
97
166
parameters :
98
167
php-version : ["8.2"]
99
168
magento-version : ["2.4.6-p11", "2.4.7-p6"]
169
+ - magento-integration-test :
170
+ matrix :
171
+ parameters :
172
+ php-version : ["8.2"]
173
+ magento-version : ["2.4.6-p11", "2.4.7-p6"]
174
+ filters :
175
+ branches :
176
+ only : chore/MAGE-1368-add-integration-tests-circleci
0 commit comments