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 79efe7e commit 3403ab0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ jobs:
test:
runs-on: ${{ matrix.os }}

services:
opentsdb:
image: petergrace/opentsdb-docker:latest
ports:
- 4242:4242
- 60030:60030

strategy:
fail-fast: false
matrix:
Expand All @@ -36,9 +29,5 @@ jobs:
- name: Install dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction

- name: Check if OpenTSDB service is running
run: |
docker ps | grep opentsdb
- name: Execute tests
run: vendor/bin/phpunit
run: APP_ENV=ci ./vendor/bin/phpunit
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ services:
- 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 3403ab0

Please sign in to comment.