[go: nahoru, domu]

Skip to content

Commit

Permalink
fixing w3c-tracecontext test startup (#668)
Browse files Browse the repository at this point in the history
* fixing w3c-tracecontext test startup
make w3c-trace-context was suffering from some bitrot, so this change gets it building and
running again. The tests themselves still fail due to further code-related bitrot.

* silence new phpstan error
  • Loading branch information
brettmc committed May 1, 2022
1 parent 4e32645 commit 4592a27
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions docker-compose.w3cTraceContext.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: '3.7'
services:
php:
user: root
build:
context: .
dockerfile: docker/Dockerfile
Expand Down
11 changes: 8 additions & 3 deletions tests/TraceContext/W3CTestService/symfony-setup
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash
set -x

git config --global user.email "otel@open-telemetry.example.com"

# Install Symfony
curl -sS https://get.symfony.com/cli/installer | bash
Expand All @@ -21,16 +24,18 @@ composer require open-telemetry/opentelemetry "*"
composer config repositories.local \
'{"type": "path", "url": "/usr/src/open-telemetry/", "options": {"symLink": true }}' \
--file composer.json
composer config minimum-stability dev --file composer.json
composer require php-http/mock-client "*"
composer require nyholm/psr7 "*"
rm composer.lock
composer clearcache
composer install

# Start the server to start listening in the background
symfony server:start -d --port=8001
symfony server:start -d --port=8001 --no-tls

# Setup the TraceContext Test Service
apt-get install -y python3-pip
pip3 install aiohttp
apk add --no-cache py3-pip py3-aiohttp

cd ..
rm -rf trace-context
Expand Down
6 changes: 2 additions & 4 deletions tests/Unit/API/Trace/NonRecordingSpanTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,8 @@ public function test_set_status(): void

public function test_end(): void
{
$this->assertNull(
// @phpstan-ignore-next-line
$this->createNonRecordingSpan()->end()
);
// @phpstan-ignore-next-line
$this->assertNull($this->createNonRecordingSpan()->end());
}

private function createNonRecordingSpan(): NonRecordingSpan
Expand Down

0 comments on commit 4592a27

Please sign in to comment.