Skip to content

Commit

Permalink
Added remote tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Geolim4 committed Jan 10, 2024
1 parent 31fe68a commit a919ed9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 15 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install Couchdb Server
run: ./tests/Scripts/install_ravendb.sh

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -48,5 +51,5 @@ jobs:
- name: Run quality tools
run: composer run-script quality

# - name: Run tests
# run: composer run-script tests
- name: Run tests
run: composer run-script tests
4 changes: 2 additions & 2 deletions tests/Configs/github-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
return (new RavendbConfig())
->setSerializeData(false)
->setItemDetailedDate(true)
->setHost(['http://127.0.0.1:8082'])
->setCollectionName('phpfastcache2')
->setHost([getenv('RAVENDB_TEST_DATABASE_HOSTNAME') ?: 'http://127.0.0.1:8082'])
->setCollectionName('phpfastcache')
->setDatabaseName('phpfastcache');
11 changes: 0 additions & 11 deletions tests/Ravendb.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*/

use Phpfastcache\CacheManager;
use Phpfastcache\EventManager;
use Phpfastcache\Exceptions\PhpfastcacheDriverConnectException;
use Phpfastcache\Tests\Helper\TestHelper;

Expand All @@ -26,16 +25,6 @@
}

try {
// EventManager::getInstance()->on(['onCouchdbCreateOptions'], static function() use ($testHelper){
// $args = func_get_args();
// $eventName = $args[array_key_last($args)];
// $testHelper->printDebugText(
// sprintf(
// 'Couchdb db event "%s" has been triggered.',
// $eventName
// )
// );
// });
$cacheInstance = CacheManager::getInstance('Ravendb', include $configFileName);
$testHelper->runCRUDTests($cacheInstance);
// $testHelper->runGetAllItemsTests($cacheInstance);
Expand Down
16 changes: 16 additions & 0 deletions tests/Scripts/install_ravendb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

curl 'http://live-test.ravendb.net/admin/databases?name=phpfastcache&replicationFactor=1' -X PUT \
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0' \
-H 'Accept: */*' \
-H 'Accept-Language: en-US,en;q=0.5' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Content-Type: application/json; charset=utf-8' \
-H 'Raven-Studio-Version: 5.4.0.0' \
-H 'X-Requested-With: XMLHttpRequest' \
-H 'Origin: http://live-test.ravendb.net' \
-H 'Connection: keep-alive' \
-H 'Referer: http://live-test.ravendb.net/studio/index.html' \
-H 'Pragma: no-cache' \
-H 'Cache-Control: no-cache' \
--data-raw '{"DatabaseName":"phpfastcache","Settings":{},"Disabled":false,"Encrypted":false,"Topology":{"DynamicNodesDistribution":false},"Sharding":null}';

0 comments on commit a919ed9

Please sign in to comment.