Skip to content

Conversation

basepi
Copy link
Contributor

@basepi basepi commented Oct 14, 2021

Testing against both master and the latest release seemed like a good idea. However, when there are changes in elastic-apm that make these tests fail, you can't fix the master failures without causing failures against the latest release.

This PR reverts #64 and then moves to always testing against elastic-apm @ master. Going forward, we'll release ecs-logging-python whenever we release elastic-apm to prevent incompatibilities with the latest release.

The tests on this PR will likely fail (due to the currently-failing master-targeted tests that I'm working on fixing shortly).

@ghost
Copy link

ghost commented Oct 14, 2021

💔 Tests Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-10-14T16:25:33.923+0000

  • Duration: 8 min 54 sec

  • Commit: 044cbf7

Test stats 🧪

Test Results
Failed 3
Passed 159
Skipped 0
Total 162

Test errors 3

Expand to view the tests failures

Test / Matrix - VERSION = '3.6' / Test / test_elasticapm_structlog_log_correlation_ecs_fields – tests.test_apm
    Expand to view the error details

     assert {'ecs': {'ver...ervice'}, ...} == {'ecs': {'ver...message', ...}
      Omitting 6 identical items, use -vv to show
      Differing items:
      {'message': "{'dataset': 'apm-service'}"} != {'message': 'test message'}
      Right contains 1 more item:
      {'event': {'dataset': 'apm-service'}}
      Use -v to get the full diff 
    

    Expand to view the stacktrace

     spec_validator = <function spec_validator.<locals>.validator at 0x7f46452876a8>
    apm = <elasticapm.base.Client object at 0x7f464528ba58>
    
        def test_elasticapm_structlog_log_correlation_ecs_fields(spec_validator, apm):
            stream = StringIO()
            logger = structlog.PrintLogger(stream)
            logger = structlog.wrap_logger(
                logger, processors=[structlog_processor, ecs_logging.StructlogFormatter()]
            )
            log = logger.new()
        
            apm.begin_transaction("test-transaction")
            try:
                with elasticapm.capture_span("test-span"):
                    span_id = elasticapm.get_span_id()
                    trace_id = elasticapm.get_trace_id()
                    transaction_id = elasticapm.get_transaction_id()
        
                    log.info("test message")
            finally:
                apm.end_transaction("test-transaction")
        
            ecs = json.loads(spec_validator(stream.getvalue().rstrip()))
            ecs.pop("@timestamp")
    >       assert ecs == {
                "ecs": {"version": "1.6.0"},
                "log.level": "info",
                "message": "test message",
                "span": {"id": span_id},
                "trace": {"id": trace_id},
                "transaction": {"id": transaction_id},
                "service": {"name": "apm-service"},
                "event": {"dataset": "apm-service"},
            }
    E       assert {'ecs': {'ver...ervice'}, ...} == {'ecs': {'ver...message', ...}
    E         Omitting 6 identical items, use -vv to show
    E         Differing items:
    E         {'message': "{'dataset': 'apm-service'}"} != {'message': 'test message'}
    E         Right contains 1 more item:
    E         {'event': {'dataset': 'apm-service'}}
    E         Use -v to get the full diff
    
    tests/test_apm.py:51: AssertionError 
    

Test / Matrix - VERSION = '3.7' / Test / test_elasticapm_structlog_log_correlation_ecs_fields – tests.test_apm
    Expand to view the error details

     assert {'ecs': {'ver...ervice'}, ...} == {'ecs': {'ver...message', ...}
      Omitting 6 identical items, use -vv to show
      Differing items:
      {'message': "{'dataset': 'apm-service'}"} != {'message': 'test message'}
      Right contains 1 more item:
      {'event': {'dataset': 'apm-service'}}
      Use -v to get the full diff 
    

    Expand to view the stacktrace

     spec_validator = <function spec_validator.<locals>.validator at 0x7f61bfbaa290>
    apm = <elasticapm.base.Client object at 0x7f61bf5d2d10>
    
        def test_elasticapm_structlog_log_correlation_ecs_fields(spec_validator, apm):
            stream = StringIO()
            logger = structlog.PrintLogger(stream)
            logger = structlog.wrap_logger(
                logger, processors=[structlog_processor, ecs_logging.StructlogFormatter()]
            )
            log = logger.new()
        
            apm.begin_transaction("test-transaction")
            try:
                with elasticapm.capture_span("test-span"):
                    span_id = elasticapm.get_span_id()
                    trace_id = elasticapm.get_trace_id()
                    transaction_id = elasticapm.get_transaction_id()
        
                    log.info("test message")
            finally:
                apm.end_transaction("test-transaction")
        
            ecs = json.loads(spec_validator(stream.getvalue().rstrip()))
            ecs.pop("@timestamp")
    >       assert ecs == {
                "ecs": {"version": "1.6.0"},
                "log.level": "info",
                "message": "test message",
                "span": {"id": span_id},
                "trace": {"id": trace_id},
                "transaction": {"id": transaction_id},
                "service": {"name": "apm-service"},
                "event": {"dataset": "apm-service"},
            }
    E       assert {'ecs': {'ver...ervice'}, ...} == {'ecs': {'ver...message', ...}
    E         Omitting 6 identical items, use -vv to show
    E         Differing items:
    E         {'message': "{'dataset': 'apm-service'}"} != {'message': 'test message'}
    E         Right contains 1 more item:
    E         {'event': {'dataset': 'apm-service'}}
    E         Use -v to get the full diff
    
    tests/test_apm.py:51: AssertionError 
    

Test / Matrix - VERSION = '3.8' / Test / test_elasticapm_structlog_log_correlation_ecs_fields – tests.test_apm
    Expand to view the error details

     assert {'ecs': {'ver...ervice'}, ...} == {'ecs': {'ver...message', ...}
      Omitting 6 identical items, use -vv to show
      Differing items:
      {'message': "{'dataset': 'apm-service'}"} != {'message': 'test message'}
      Right contains 1 more item:
      {'event': {'dataset': 'apm-service'}}
      Use -v to get the full diff 
    

    Expand to view the stacktrace

     spec_validator = <function spec_validator.<locals>.validator at 0x7f5328874c10>
    apm = <elasticapm.base.Client object at 0x7f53276eb4c0>
    
        def test_elasticapm_structlog_log_correlation_ecs_fields(spec_validator, apm):
            stream = StringIO()
            logger = structlog.PrintLogger(stream)
            logger = structlog.wrap_logger(
                logger, processors=[structlog_processor, ecs_logging.StructlogFormatter()]
            )
            log = logger.new()
        
            apm.begin_transaction("test-transaction")
            try:
                with elasticapm.capture_span("test-span"):
                    span_id = elasticapm.get_span_id()
                    trace_id = elasticapm.get_trace_id()
                    transaction_id = elasticapm.get_transaction_id()
        
                    log.info("test message")
            finally:
                apm.end_transaction("test-transaction")
        
            ecs = json.loads(spec_validator(stream.getvalue().rstrip()))
            ecs.pop("@timestamp")
    >       assert ecs == {
                "ecs": {"version": "1.6.0"},
                "log.level": "info",
                "message": "test message",
                "span": {"id": span_id},
                "trace": {"id": trace_id},
                "transaction": {"id": transaction_id},
                "service": {"name": "apm-service"},
                "event": {"dataset": "apm-service"},
            }
    E       assert {'ecs': {'ver...ervice'}, ...} == {'ecs': {'ver...message', ...}
    E         Omitting 6 identical items, use -vv to show
    E         Differing items:
    E         {'message': "{'dataset': 'apm-service'}"} != {'message': 'test message'}
    E         Right contains 1 more item:
    E         {'event': {'dataset': 'apm-service'}}
    E         Use -v to get the full diff
    
    tests/test_apm.py:51: AssertionError 
    

Steps errors 4

Expand to view the steps failures

Shell Script
  • Took 0 min 19 sec . View more details here
  • Description: .ci/scripts/test.sh 3.5
Shell Script
  • Took 1 min 31 sec . View more details here
  • Description: .ci/scripts/test.sh 3.6
Shell Script
  • Took 1 min 35 sec . View more details here
  • Description: .ci/scripts/test.sh 3.7
Shell Script
  • Took 1 min 33 sec . View more details here
  • Description: .ci/scripts/test.sh 3.8

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@basepi basepi merged commit fca42f1 into elastic:master Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant