Jedore commented on PR #276:
URL:
https://github.com/apache/skywalking-python/pull/276#issuecomment-1418889966
> > And i'm not familiar with yaml. expected.data.yml takes too much time
and still seems not valid. 😢
>
> What do you mean? Anything blocks you?
I run the test command in my repo, but failed, as:
```text
=================================== FAILURES
===================================
____________________ TestPlugin.test_plugin[loguru==0.6.0]
_____________________
self = <tests.plugin.data.sw_loguru.test_loguru.TestPlugin object at
0x7fae8eb14fd0>
docker_compose = <testcontainers.compose.DockerCompose object at
0x7fae8ea683a0>
version = 'loguru==0.6.0'
@pytest.mark.parametrize('version', get_test_vector(lib_name='loguru',
support_matrix=support_matrix))
def test_plugin(self, docker_compose, version):
> self.validate()
tests/plugin/data/sw_loguru/test_loguru.py:36:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _
self = <tests.plugin.data.sw_loguru.test_loguru.TestPlugin object at
0x7fae8eb14fd0>
expected_file_name =
'/home/runner/work/skywalking-python/skywalking-python/tests/plugin/data/sw_loguru/expected.data.yml'
def validate(self, expected_file_name=None):
# type: (str) -> Response
if expected_file_name is None:
expected_file_name =
os.path.join(dirname(inspect.getfile(self.__class__)), 'expected.data.yml')
# time.sleep(10)
with open(expected_file_name) as expected_data_file:
expected_data = os.linesep.join(expected_data_file.readlines())
response =
requests.post(url='http://localhost:12800/dataValidate', data=expected_data)
if response.status_code != 200:
res = requests.get('http://localhost:12800/receiveData')
actual_data = yaml.dump(yaml.load(res.content,
Loader=Loader))
differ = Differ()
diff_list = list(differ.compare(
actual_data.splitlines(keepends=True),
yaml.dump(yaml.load(expected_data,
Loader=Loader)).splitlines(keepends=True)
))
print('diff list: ')
sys.stdout.writelines(diff_list)
> assert response.status_code == 200
E AssertionError
tests/plugin/base.py:62: AssertionError
---------------------------- Captured stdout setup
-----------------------------
7f20775e0631356c4823d9372b09d653db0e6540: Pulling from
apache/skywalking-agent-test-tool/mock-collector
Digest:
sha256:8c010883c8203a34f1239c6487855c5ba5b40a4c52faf8d21ccc3b5073438[221](https://github.com/Jedore/skywalking-python/actions/runs/4102318884/jobs/7075166151#step:6:222)
Status: Downloaded newer image for
ghcr.io/apache/skywalking-agent-test-tool/mock-collector:7f20775e0631356c4823d9372b09d653db0e6540
---------------------------- Captured stderr setup
-----------------------------
Creating network "sw_loguru_beyond" with the default driver
Pulling collector
(ghcr.io/apache/skywalking-agent-test-tool/mock-collector:7f20775e0631356c4823d9372b09d653db0e6540)...
Creating sw_loguru_collector_1 ...
Creating sw_loguru_collector_1 ... done
Creating sw_loguru_provider_1 ...
Creating sw_loguru_provider_1 ... done
Creating sw_loguru_consumer_1 ...
Creating sw_loguru_consumer_1 ... done
----------------------------- Captured stdout call
-----------------------------
diff list:
logItems:
- logSize: 4
logs:
- body:
content:
text: Loguru provider error reported.
type: text
endpoint: /users
layer: ''
tags:
data:
- key: level
value: ERROR
- key: logger
value: loguru
- key: thread
- value: MainThread
+ value: not null
- key: exception
+ value: not null
+ timestamp: gt 0
- value: "Traceback (most recent call last):\n File
\"/app/services/provider.py\"\
- , line 36, in application\n raise Exception('Loguru Exception
Test.')\n\
- Exception: Loguru Exception Test.\n"
- timestamp: 1675678728625
traceContext:
spanId: 0
- traceId:
a4f8cfd2a60711edb5500[242](https://github.com/Jedore/skywalking-python/actions/runs/4102318884/jobs/7075166151#step:6:243)ac120004
- traceSegmentId: a4f95e52a60711edb8a30242ac120003
+ traceId: not null
+ traceSegmentId: not null
- body:
content:
+ text: not null
- text: "2023-02-06 10:18:49,125 [MainThread] ERROR root - Logging
provider\
- \ error reported.\nTraceback (most recent call last):\n File
\"/app/services/provider.py\"\
- , line 36, in application\n raise Exception('Loguru Exception
Test.')\n\
- Exception: Loguru Exception Test."
type: text
endpoint: /users
layer: ''
tags:
data:
- key: level
value: ERROR
- key: logger
value: root
- key: thread
- value: MainThread
- timestamp: 1675678729126
+ value: not null
+ - key: exception
+ value: not null
+ timestamp: gt 0
traceContext:
spanId: 0
- traceId: a4f8cfd2a60711edb5500242ac120004
- traceSegmentId: a4f95e52a60711edb8a30242ac120003
+ traceId: not null
+ traceSegmentId: not null
- body:
content:
text: Loguru provider warning reported.
type: text
endpoint: /users
layer: ''
tags:
data:
- key: level
value: WARNING
- key: logger
value: loguru
- key: thread
- value: MainThread
- timestamp: 1675678730128
+ value: not null
+ timestamp: gt 0
traceContext:
spanId: 0
- traceId: a4f8cfd2a60711edb5500242ac120004
- traceSegmentId: a4f95e52a60711edb8a30242ac120003
+ traceId: not null
+ traceSegmentId: not null
- body:
content:
+ text: Logging provider info reported.
- text: 2023-02-06 10:18:50,628 [MainThread] CRITICAL root - Logging
provider
- critical reported.
type: text
endpoint: /users
layer: ''
tags:
data:
- key: level
value: CRITICAL
- key: logger
value: root
- key: thread
- value: MainThread
- timestamp: 1675678730629
+ value: not null
+ timestamp: gt 0
traceContext:
spanId: 0
- traceId: a4f8cfd2a60711edb5500242ac120004
- traceSegmentId: a4f95e52a60711edb8a30242ac120003
+ traceId: not null
+ traceSegmentId: not null
serviceName: provider
meterItems: []
segmentItems:
- segmentSize: 1
segments:
- - segmentId: a4f95e52a60711edb8a30242ac120003
+ - segmentId: not null
spans:
- componentId: 7014
- endTime: 1675678730630
+ endTime: gt 0
isError: false
operationName: /users
parentSpanId: -1
- peer: 172.18.0.4:48448
+ peer: not null
refs:
- - networkAddress: provider:9091
+ - networkAddress: not null
parentEndpoint: /users
parentService: consumer
- parentServiceInstance: a124c208a60711edb5500242ac120004
+ parentServiceInstance: not null
parentSpanId: 1
- parentTraceSegmentId: a4f8ce4ca60711edb5500242ac120004
+ parentTraceSegmentId: not null,
refType: CrossProcess
- traceId: a4f8cfd2a60711edb5500242ac120004
+ traceId: not null
skipAnalysis: false
spanId: 0
spanLayer: Http
spanType: Entry
- startTime:
16756787[281](https://github.com/Jedore/skywalking-python/actions/runs/4102318884/jobs/7075166151#step:6:282)14
+ startTime: gt 0
tags:
- key: http.method
value: GET
- key: http.url
- value: http://provider:9091/users
+ value: not null
- key: http.status_code
value: '200'
serviceName: provider
- segmentSize: 1
segments:
- - segmentId: a4f8ce4ca60711edb5500242ac120004
+ - segmentId: not null
spans:
- componentId: 7002
- endTime:
16756787[306](https://github.com/Jedore/skywalking-python/actions/runs/4102318884/jobs/7075166151#step:6:307)30
+ endTime: gt 0
isError: false
operationName: /users
parentSpanId: 0
- peer: provider:9091
+ peer: ''
skipAnalysis: false
spanId: 1
spanLayer: Http
spanType: Exit
- startTime: 1675678728110
+ startTime: gt 0
+ tags:
+ - key: http.url
+ value: not null
+ - key: http.method
+ value: GET
+ - key: http.status_code
+ value: '200'
+ - segmentId: not null
+ spans:
+ - componentId: 7014
+ endTime: gt 0
+ isError: false
+ operationName: /users
+ parentSpanId: -1
+ peer: not null
+ skipAnalysis: false
+ spanId: 0
+ spanLayer: Http
+ spanType: Entry
+ startTime: gt 0
tags:
- key: http.method
value: GET
- key: http.url
+ value: not null
- value: http://provider:9091/users
- - key: http.status_code
- value: '200'
- - componentId: 7014
- endTime: 1675678730636
- isError: false
- operationName: /users
- parentSpanId: -1
- peer: 172.18.0.1:50156
- skipAnalysis: false
- spanId: 0
- spanLayer: Http
- spanType: Entry
- startTime: 1675678728110
- tags:
- - key: http.method
- value: GET
- - key: http.url
- value: http://0.0.0.0:9090/users
- key: http.status_code
value: '200'
serviceName: consumer
--------------------------- Captured stderr teardown
---------------------------
```
So i only can commited the fixed code firstly and look for your help.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]