Skip to content

Commit

Permalink
Add opentsdb to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
antonkomarev committed Sep 2, 2024
1 parent 8cbf9aa commit ddcc97c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
php: [8.3, 8.2, 8.1, 8.0]
dependency-version: [prefer-lowest, prefer-stable]

Expand All @@ -29,4 +30,4 @@ jobs:
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction

- name: Execute tests
run: vendor/bin/phpunit
run: APP_ENV=ci ./vendor/bin/phpunit
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ services:
container_name: php-opentsdb-client-lib-opentsdb
image: petergrace/opentsdb-docker:latest
environment:
- WAITSECS=30 # Give time for hbase to shutdown, otherwise data corruption may result
- WAITSECS=30 # Give time for hbase to shut down, otherwise data corruption may result
ports:
- 4242:4242
- 60030:60030
networks:
- php-opentsdb-client-lib
volumes:
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
</testsuite>
</testsuites>
<php>
<server name="APP_ENV" value="testing"/>
<env name="APP_ENV" value="testing"/>
</php>
</phpunit>
6 changes: 4 additions & 2 deletions test/Integration/OpenTsdbClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ final class OpenTsdbClientTest extends TestCase
{
public function testSuccess(): void
{
$this->markTestSkipped('Only for development environment. Need to pull opentsdb container to GitHub.');
if ($_ENV['APP_ENV'] === 'ci') {
$this->markTestSkipped('Only for development environment. Need to pull opentsdb container to GitHub.');
}

$dataPointList[] = new DataPoint(
metric: 'temperature',
Expand Down Expand Up @@ -56,7 +58,7 @@ private function initOpenTsdbClient(): OpenTsdbClient
'http_errors' => false,
],
),
baseUri: 'http://opentsdb:4242',
baseUri: 'opentsdb:4242',
);
}
}

0 comments on commit ddcc97c

Please sign in to comment.