Skip to content

Commit 8474e54

Browse files
authored
Update CI testing (#1140)
1 parent 7bbda48 commit 8474e54

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

.circleci/config.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,18 @@ shared: &shared
4141
name: Before setup
4242
command: |
4343
echo 'memory_limit = 256M' | sudo tee /usr/local/etc/php/php.ini
44-
wget https://alg.li/algolia-keys && chmod +x algolia-keys
44+
45+
- run:
46+
name: Get keys from dealer
47+
command: |
48+
if [ "$CIRCLE_PR_REPONAME" ]; then
49+
curl -s https://algoliasearch-client-keygen.herokuapp.com | sh >> $BASH_ENV
50+
fi
4551
4652
- run:
4753
name: Run tests
4854
command: |
4955
cd ~/magento_directory/dev/tests/integration
50-
export CI_BUILD_NUM=$CIRCLE_BUILD_NUM
51-
export CI_PROJ_USERNAME=$CIRCLE_PROJECT_USERNAME
52-
export CI_PROJ_REPONAME=$CIRCLE_PROJECT_REPONAME
53-
eval $(~/build_directory/algoliasearch-magento-2/algolia-keys export)
5456
sudo service elasticsearch start # for some reasons has to be launched with the step
5557
sleep 10
5658
php -dmemory_limit=-1 ../../../vendor/bin/phpunit --debug ../../../vendor/algolia/algoliasearch-magento-2/Test

Test/Integration/TestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ private function bootstrap()
114114
$this->configHelper = $config = $this->getObjectManager()->create(ConfigHelper::class);
115115

116116
$this->setConfig('algoliasearch_credentials/credentials/application_id', getenv('ALGOLIA_APPLICATION_ID'));
117-
$this->setConfig('algoliasearch_credentials/credentials/search_only_api_key', getenv('ALGOLIA_SEARCH_API_KEY'));
117+
$this->setConfig('algoliasearch_credentials/credentials/search_only_api_key', getenv('ALGOLIA_SEARCH_KEY_1') ?: getenv('ALGOLIA_SEARCH_API_KEY'));
118118
$this->setConfig('algoliasearch_credentials/credentials/api_key', getenv('ALGOLIA_API_KEY'));
119119

120-
$this->indexPrefix = 'TRAVIS_M2_' . getmypid() . (getenv('INDEX_PREFIX') ?: 'magento20tests_');
120+
$this->indexPrefix = 'magento2_' . date('Y-m-d_H:i:s') . '_' . (getenv('INDEX_PREFIX') ?: 'circleci_');
121121
$this->setConfig('algoliasearch_credentials/credentials/index_prefix', $this->indexPrefix);
122122

123123
$this->boostrapped = true;

0 commit comments

Comments
 (0)