Skip to content

Commit 3403ab0

Browse files
committed
Add opentsdb to CI
1 parent 79efe7e commit 3403ab0

File tree

4 files changed

+6
-16
lines changed

4 files changed

+6
-16
lines changed

.github/workflows/tests.yml

+1-12
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ jobs:
66
test:
77
runs-on: ${{ matrix.os }}
88

9-
services:
10-
opentsdb:
11-
image: petergrace/opentsdb-docker:latest
12-
ports:
13-
- 4242:4242
14-
- 60030:60030
15-
169
strategy:
1710
fail-fast: false
1811
matrix:
@@ -36,9 +29,5 @@ jobs:
3629
- name: Install dependencies
3730
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
3831

39-
- name: Check if OpenTSDB service is running
40-
run: |
41-
docker ps | grep opentsdb
42-
4332
- name: Execute tests
44-
run: vendor/bin/phpunit
33+
run: APP_ENV=ci ./vendor/bin/phpunit

docker-compose.yml

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ services:
5858
- WAITSECS=30 # Give time for hbase to shut down, otherwise data corruption may result
5959
ports:
6060
- 4242:4242
61-
- 60030:60030
6261
networks:
6362
- php-opentsdb-client-lib
6463
volumes:

phpunit.xml.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
</testsuite>
1515
</testsuites>
1616
<php>
17-
<server name="APP_ENV" value="testing"/>
17+
<env name="APP_ENV" value="testing"/>
1818
</php>
1919
</phpunit>

test/Integration/OpenTsdbClientTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ final class OpenTsdbClientTest extends TestCase
2222
{
2323
public function testSuccess(): void
2424
{
25-
$this->markTestSkipped('Only for development environment. Need to pull opentsdb container to GitHub.');
25+
if ($_ENV['APP_ENV'] === 'ci') {
26+
$this->markTestSkipped('Only for development environment. Need to pull opentsdb container to GitHub.');
27+
}
2628

2729
$dataPointList[] = new DataPoint(
2830
metric: 'temperature',
@@ -56,7 +58,7 @@ private function initOpenTsdbClient(): OpenTsdbClient
5658
'http_errors' => false,
5759
],
5860
),
59-
baseUri: 'http://opentsdb:4242',
61+
baseUri: 'opentsdb:4242',
6062
);
6163
}
6264
}

0 commit comments

Comments
 (0)