Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APM Server specification validation #984

Merged
merged 28 commits into from
Jan 5, 2021

Conversation

russcam
Copy link
Contributor

@russcam russcam commented Oct 20, 2020

This PR introduces validation against the APM server JSON schema specification. Validation is performed in two ways:

  1. Validate agent types against the schema through reflection.

    It's possible to statically validate a large part of the agent types against the JSON schema. Where it is not possible is where agent types model the APM server specification with a structure that cannot be statically mapped to the schema properties, typically because such types have a custom JSON serialization routine that transforms instances of types to a JSON structure that matches the specification.

  2. Validate JSON input to mock APM server against the JSON schema.

This PR makes changes to the agent types in order for them to exactly match the schema. For example, the sampled field can be "null" or "boolean" within the specification, but the agent models as a bool. In chatting to @gregkalapos, it might make sense to model the specification as a set of POCOs, and leave the agent types as an implementation of the spec as opposed to an exact implementation of the spec. In modelling the spec as POCOs, these could be used outside of the agent, for example, to transform some output to an APM server input, or used by the mock APM server.

@russcam russcam requested a review from gregkalapos October 20, 2020 07:01
@codecov-io
Copy link

codecov-io commented Oct 20, 2020

Codecov Report

Merging #984 (450fad1) into master (be232d8) will decrease coverage by 5.21%.
The diff coverage is 64.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #984      +/-   ##
==========================================
- Coverage   79.26%   74.05%   -5.22%     
==========================================
  Files         151      157       +6     
  Lines        7472     7945     +473     
==========================================
- Hits         5923     5884      -39     
- Misses       1549     2061     +512     
Impacted Files Coverage Δ
src/Elastic.Apm/Agent.cs 70.73% <ø> (ø)
src/Elastic.Apm/Api/SpanContext.cs 46.15% <0.00%> (-13.85%) ⬇️
src/Elastic.Apm/Model/NoopSpan.cs 46.03% <ø> (-1.59%) ⬇️
src/Elastic.Apm/Model/NoopTransaction.cs 41.66% <ø> (-2.09%) ⬇️
src/Elastic.Apm/Model/Span.cs 94.80% <ø> (ø)
src/Elastic.Apm/Report/PayloadSenderV2.cs 87.50% <ø> (-1.39%) ⬇️
...c/Elastic.Apm.Specification/TypeValidationError.cs 25.00% <25.00%> (ø)
.../Elastic.Apm.Specification/TypeValidationResult.cs 50.00% <50.00%> (ø)
...tic.Apm.SqlClient/SqlClientDiagnosticSubscriber.cs 86.66% <50.00%> (-5.65%) ⬇️
.../Elastic.Apm.Specification/JsonSchemaExtensions.cs 55.55% <55.55%> (ø)
... and 41 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c35d120...450fad1. Read the comment docs.

@apmmachine
Copy link
Contributor

apmmachine commented Oct 20, 2020

💔 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

Expand to view the summary

Build stats

  • Build Cause: Branch indexing

  • Start Time: 2021-01-04T02:20:18.792+0000

  • Duration: 78 min 22 sec

Test stats 🧪

Test Results
Failed 91
Passed 16515
Skipped 0
Total 16606

Test errors 91

Expand to view the tests failures

> Show only the first 10 test failures

Initializing / Parallel / Windows .NET Framework / IIS Tests / CaptureHeadersConfigDisabledTest.Elastic.Apm.AspNetFullFramework.Tests.CaptureHeadersConfigDisabledTest.Test – Elastic.Apm.AspNetFullFramework.Tests.CaptureHeadersConfigDisabledTest
    Expand to view the error details

     Expected receivedData.Transactions.Count to be 1, but found 0. 
    

    Expand to view the stacktrace

     Expected receivedData.Transactions.Count to be 1, but found 0.
    Stack Trace:
       at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
       at FluentAssertions.Execution.AssertionScope.FailWith(Func`1 failReasonFunc) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 181
       at FluentAssertions.Numeric.NumericAssertions`1.Be(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 50
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.VerifyReceivedDataSharedConstraints(SampleAppUrlPathData sampleAppUrlPathData, ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 512
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.<>c__DisplayClass32_0.<WaitAndVerifyReceivedDataSharedConstraints>b__0(ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 505
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 360
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 398
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndVerifyReceivedDataSharedConstraints(SampleAppUrlPathData sampleAppUrlPathData, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 505
       at Elastic.Apm.AspNetFullFramework.Tests.CaptureHeadersConfigDisabledTest.Test(SampleAppUrlPathData sampleAppUrlPathData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CaptureHeadersConfigDisabledTest.cs:line 27
    --- End of stack trace from previous location where exception was thrown ---
     
    

Initializing / Parallel / Windows .NET Framework / IIS Tests / CaptureHeadersConfigDisabledTest.Elastic.Apm.AspNetFullFramework.Tests.CaptureHeadersConfigDisabledTest.Test – Elastic.Apm.AspNetFullFramework.Tests.CaptureHeadersConfigDisabledTest
    Expand to view the error details

     Expected receivedData.Transactions.Count to be 1, but found 0. 
    

    Expand to view the stacktrace

     Expected receivedData.Transactions.Count to be 1, but found 0.
    Stack Trace:
       at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
       at FluentAssertions.Execution.AssertionScope.FailWith(Func`1 failReasonFunc) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 181
       at FluentAssertions.Numeric.NumericAssertions`1.Be(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 50
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.VerifyReceivedDataSharedConstraints(SampleAppUrlPathData sampleAppUrlPathData, ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 512
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.<>c__DisplayClass32_0.<WaitAndVerifyReceivedDataSharedConstraints>b__0(ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 505
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 360
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 398
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndVerifyReceivedDataSharedConstraints(SampleAppUrlPathData sampleAppUrlPathData, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 505
       at Elastic.Apm.AspNetFullFramework.Tests.CaptureHeadersConfigDisabledTest.Test(SampleAppUrlPathData sampleAppUrlPathData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CaptureHeadersConfigDisabledTest.cs:line 27
    --- End of stack trace from previous location where exception was thrown ---
     
    

Initializing / Parallel / Windows .NET Framework / IIS Tests / CaptureHeadersConfigDisabledTest.Elastic.Apm.AspNetFullFramework.Tests.CaptureHeadersConfigDisabledTest.Test – Elastic.Apm.AspNetFullFramework.Tests.CaptureHeadersConfigDisabledTest
    Expand to view the error details

     Expected receivedData.Transactions.Count to be 2, but found 0. 
    

    Expand to view the stacktrace

     Expected receivedData.Transactions.Count to be 2, but found 0.
    Stack Trace:
       at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
       at FluentAssertions.Execution.AssertionScope.FailWith(Func`1 failReasonFunc) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 181
       at FluentAssertions.Numeric.NumericAssertions`1.Be(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 50
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.VerifyReceivedDataSharedConstraints(SampleAppUrlPathData sampleAppUrlPathData, ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 512
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.<>c__DisplayClass32_0.<WaitAndVerifyReceivedDataSharedConstraints>b__0(ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 505
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 360
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 398
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndVerifyReceivedDataSharedConstraints(SampleAppUrlPathData sampleAppUrlPathData, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 505
       at Elastic.Apm.AspNetFullFramework.Tests.CaptureHeadersConfigDisabledTest.Test(SampleAppUrlPathData sampleAppUrlPathData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CaptureHeadersConfigDisabledTest.cs:line 27
    --- End of stack trace from previous location where exception was thrown ---
     
    

Initializing / Parallel / Windows .NET Framework / IIS Tests / CaptureHeadersConfigDisabledTest.Elastic.Apm.AspNetFullFramework.Tests.CaptureHeadersConfigDisabledTest.Test – Elastic.Apm.AspNetFullFramework.Tests.CaptureHeadersConfigDisabledTest
    Expand to view the error details

     Expected receivedData.Transactions.Count to be 1, but found 0. 
    

    Expand to view the stacktrace

     Expected receivedData.Transactions.Count to be 1, but found 0.
    Stack Trace:
       at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
       at FluentAssertions.Execution.AssertionScope.FailWith(Func`1 failReasonFunc) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 181
       at FluentAssertions.Numeric.NumericAssertions`1.Be(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 50
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.VerifyReceivedDataSharedConstraints(SampleAppUrlPathData sampleAppUrlPathData, ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 512
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.<>c__DisplayClass32_0.<WaitAndVerifyReceivedDataSharedConstraints>b__0(ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 505
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 360
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 398
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndVerifyReceivedDataSharedConstraints(SampleAppUrlPathData sampleAppUrlPathData, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 505
       at Elastic.Apm.AspNetFullFramework.Tests.CaptureHeadersConfigDisabledTest.Test(SampleAppUrlPathData sampleAppUrlPathData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CaptureHeadersConfigDisabledTest.cs:line 27
    --- End of stack trace from previous location where exception was thrown ---
     
    

Initializing / Parallel / Windows .NET Framework / IIS Tests / CaptureHeadersConfigDisabledTest.Elastic.Apm.AspNetFullFramework.Tests.CaptureHeadersConfigDisabledTest.Test – Elastic.Apm.AspNetFullFramework.Tests.CaptureHeadersConfigDisabledTest
    Expand to view the error details

     Expected receivedData.Transactions.Count to be 1, but found 0. 
    

    Expand to view the stacktrace

     Expected receivedData.Transactions.Count to be 1, but found 0.
    Stack Trace:
       at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
       at FluentAssertions.Execution.AssertionScope.FailWith(Func`1 failReasonFunc) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 181
       at FluentAssertions.Numeric.NumericAssertions`1.Be(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 50
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.VerifyReceivedDataSharedConstraints(SampleAppUrlPathData sampleAppUrlPathData, ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 512
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.<>c__DisplayClass32_0.<WaitAndVerifyReceivedDataSharedConstraints>b__0(ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 505
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 360
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 398
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndVerifyReceivedDataSharedConstraints(SampleAppUrlPathData sampleAppUrlPathData, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 505
       at Elastic.Apm.AspNetFullFramework.Tests.CaptureHeadersConfigDisabledTest.Test(SampleAppUrlPathData sampleAppUrlPathData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CaptureHeadersConfigDisabledTest.cs:line 27
    --- End of stack trace from previous location where exception was thrown ---
     
    

Initializing / Parallel / Windows .NET Framework / IIS Tests / CaptureUserTests.Elastic.Apm.AspNetFullFramework.Tests.CaptureUserTests.User_Should_Contain_Id_And_Email_When_Using_Authenticated_ClaimsPrincipal – Elastic.Apm.AspNetFullFramework.Tests.CaptureUserTests
    Expand to view the error details

     Expected received.Transactions.Count to be greater than 0, but found 0. 
    

    Expand to view the stacktrace

     Expected received.Transactions.Count to be greater than 0, but found 0.
    Stack Trace:
       at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
       at FluentAssertions.Execution.AssertionScope.FailWith(Func`1 failReasonFunc) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 181
       at FluentAssertions.Numeric.NumericAssertions`1.BeGreaterThan(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 218
       at Elastic.Apm.AspNetFullFramework.Tests.CaptureUserTests.<>c__DisplayClass1_0.<User_Should_Contain_Id_And_Email_When_Using_Authenticated_ClaimsPrincipal>b__0(ReceivedData received) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CaptureUserTests.cs:line 61
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 360
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 398
       at Elastic.Apm.AspNetFullFramework.Tests.CaptureUserTests.User_Should_Contain_Id_And_Email_When_Using_Authenticated_ClaimsPrincipal() in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CaptureUserTests.cs:line 59
    --- End of stack trace from previous location where exception was thrown ---
     
    

Initializing / Parallel / Windows .NET Framework / IIS Tests / CentralConfigTests+MaxSpansAndSampleRateTests.Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests+MaxSpansAndSampleRateTests.SampleRate_valid_value(isSampledLocalConfig: False) – Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests+MaxSpansAndSampleRateTests
    Expand to view the error details

     Expected receivedData.Transactions.Count to be 1, but found 0. 
    

    Expand to view the stacktrace

     Expected receivedData.Transactions.Count to be 1, but found 0.
    Stack Trace:
       at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
       at FluentAssertions.Execution.AssertionScope.FailWith(Func`1 failReasonFunc) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 181
       at FluentAssertions.Numeric.NumericAssertions`1.Be(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 50
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.VerifyReceivedDataSharedConstraints(SampleAppUrlPathData sampleAppUrlPathData, ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 512
       at Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests.MaxSpansAndSampleRateTests.<>c__DisplayClass8_1.<TestImpl>b__3(ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CentralConfigTests.cs:line 262
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 360
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 398
       at Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests.MaxSpansAndSampleRateTests.<>c__DisplayClass8_0.<<TestImpl>g__SendRequestAssertReceivedData|2>d.MoveNext() in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CentralConfigTests.cs:line 260
    --- End of stack trace from previous location where exception was thrown ---
       at Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests.MaxSpansAndSampleRateTests.TestImpl(IReadOnlyCollection`1 testParamsPerStep, Int32 spansToExecCountForInitialRequest, Nullable`1 maxSpansLocalConfig, Nullable`1 isSampledLocalConfig) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CentralConfigTests.cs:line 230
       at Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests.MaxSpansAndSampleRateTests.SampleRate_valid_value(Nullable`1 isSampledLocalConfig) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CentralConfigTests.cs:line 118
    --- End of stack trace from previous location where exception was thrown ---
     
    

Initializing / Parallel / Windows .NET Framework / IIS Tests / CentralConfigTests+MaxSpansAndSampleRateTests.Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests+MaxSpansAndSampleRateTests.SampleRate_valid_value(isSampledLocalConfig: True) – Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests+MaxSpansAndSampleRateTests
    Expand to view the error details

     Expected receivedData.Transactions.Count to be 1, but found 0. 
    

    Expand to view the stacktrace

     Expected receivedData.Transactions.Count to be 1, but found 0.
    Stack Trace:
       at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
       at FluentAssertions.Execution.AssertionScope.FailWith(Func`1 failReasonFunc) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 181
       at FluentAssertions.Numeric.NumericAssertions`1.Be(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 50
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.VerifyReceivedDataSharedConstraints(SampleAppUrlPathData sampleAppUrlPathData, ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 512
       at Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests.MaxSpansAndSampleRateTests.<>c__DisplayClass8_1.<TestImpl>b__3(ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CentralConfigTests.cs:line 262
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 360
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 398
       at Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests.MaxSpansAndSampleRateTests.<>c__DisplayClass8_0.<<TestImpl>g__SendRequestAssertReceivedData|2>d.MoveNext() in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CentralConfigTests.cs:line 260
    --- End of stack trace from previous location where exception was thrown ---
       at Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests.MaxSpansAndSampleRateTests.TestImpl(IReadOnlyCollection`1 testParamsPerStep, Int32 spansToExecCountForInitialRequest, Nullable`1 maxSpansLocalConfig, Nullable`1 isSampledLocalConfig) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CentralConfigTests.cs:line 230
       at Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests.MaxSpansAndSampleRateTests.SampleRate_valid_value(Nullable`1 isSampledLocalConfig) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CentralConfigTests.cs:line 118
    --- End of stack trace from previous location where exception was thrown ---
     
    

Initializing / Parallel / Windows .NET Framework / IIS Tests / CentralConfigTests+MaxSpansAndSampleRateTests.Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests+MaxSpansAndSampleRateTests.SampleRate_valid_value(isSampledLocalConfig: null) – Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests+MaxSpansAndSampleRateTests
    Expand to view the error details

     Expected receivedData.Transactions.Count to be 1, but found 0. 
    

    Expand to view the stacktrace

     Expected receivedData.Transactions.Count to be 1, but found 0.
    Stack Trace:
       at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
       at FluentAssertions.Execution.AssertionScope.FailWith(Func`1 failReasonFunc) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 181
       at FluentAssertions.Numeric.NumericAssertions`1.Be(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 50
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.VerifyReceivedDataSharedConstraints(SampleAppUrlPathData sampleAppUrlPathData, ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 512
       at Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests.MaxSpansAndSampleRateTests.<>c__DisplayClass8_1.<TestImpl>b__3(ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CentralConfigTests.cs:line 262
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 360
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 398
       at Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests.MaxSpansAndSampleRateTests.<>c__DisplayClass8_0.<<TestImpl>g__SendRequestAssertReceivedData|2>d.MoveNext() in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CentralConfigTests.cs:line 260
    --- End of stack trace from previous location where exception was thrown ---
       at Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests.MaxSpansAndSampleRateTests.TestImpl(IReadOnlyCollection`1 testParamsPerStep, Int32 spansToExecCountForInitialRequest, Nullable`1 maxSpansLocalConfig, Nullable`1 isSampledLocalConfig) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CentralConfigTests.cs:line 230
       at Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests.MaxSpansAndSampleRateTests.SampleRate_valid_value(Nullable`1 isSampledLocalConfig) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CentralConfigTests.cs:line 118
    --- End of stack trace from previous location where exception was thrown ---
     
    

Initializing / Parallel / Windows .NET Framework / IIS Tests / CentralConfigTests+MaxSpansAndSampleRateTests.Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests+MaxSpansAndSampleRateTests.Combination_of_both_options(maxSpansLocalConfig: 10, isSampledLocalConfig: False) – Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests+MaxSpansAndSampleRateTests
    Expand to view the error details

     Expected receivedData.Transactions.Count to be 1, but found 0. 
    

    Expand to view the stacktrace

     Expected receivedData.Transactions.Count to be 1, but found 0.
    Stack Trace:
       at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
       at FluentAssertions.Execution.AssertionScope.FailWith(Func`1 failReasonFunc) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 181
       at FluentAssertions.Numeric.NumericAssertions`1.Be(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 50
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.VerifyReceivedDataSharedConstraints(SampleAppUrlPathData sampleAppUrlPathData, ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 512
       at Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests.MaxSpansAndSampleRateTests.<>c__DisplayClass8_1.<TestImpl>b__3(ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CentralConfigTests.cs:line 262
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 360
       at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 398
       at Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests.MaxSpansAndSampleRateTests.<>c__DisplayClass8_0.<<TestImpl>g__SendRequestAssertReceivedData|2>d.MoveNext() in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CentralConfigTests.cs:line 260
    --- End of stack trace from previous location where exception was thrown ---
       at Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests.MaxSpansAndSampleRateTests.TestImpl(IReadOnlyCollection`1 testParamsPerStep, Int32 spansToExecCountForInitialRequest, Nullable`1 maxSpansLocalConfig, Nullable`1 isSampledLocalConfig) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CentralConfigTests.cs:line 230
       at Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests.MaxSpansAndSampleRateTests.Combination_of_both_options(Nullable`1 maxSpansLocalConfig, Nullable`1 isSampledLocalConfig) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CentralConfigTests.cs:line 168
    --- End of stack trace from previous location where exception was thrown ---
     
    

Steps errors 1

Expand to view the steps failures

Test IIS
  • Took 32 min 26 sec . View more details on here
  • Description: .ci/windows/test-iis.bat

Log output

Expand to view the last 100 lines of log output

[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>                     "name": "AspNetFullFramework_Tests_CentralConfigTests-CustomServiceName",
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>                     "node": {},
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>                     "runtime": {
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>                         "name": ".NET Framework",
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>                         "version": "4.8.4018.0"
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>                     }
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>                 },
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>                 "system": {
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>                     "detected_hostname": "kdl-apm-windows-2019",
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>                     "hostname": "AspNetFullFramework_Tests_CentralConfigTests-CustomHostName"
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>                 }
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>             }
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>         }
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>     Parsed object:
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>         MetadataDto{Service: Service{Name: AspNetFullFramework_Tests_CentralConfigTests-CustomServiceName, Version: null, Environment: AspNetFullFramework_Tests_CentralConfigTests-CustomEnvironment, Runtime: Runtime{Name: .NET Framework, Version: 4.8.4018.0}, Framework: Framework{Name: ASP.NET, Version: 4.8.3928.0}, Agent: AgentC{Name: dotnet, Version: 1.7.1}, Language: Language{Name: C#}, Node: Node{ConfiguredName: null}}, System: System{Container: null, DetectedHostName: kdl-apm-windows-2019, HostName: AspNetFullFramework_Tests_CentralConfigTests-CustomHostName}, Labels: <null>}
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit> +-> Exception: System.IO.FileNotFoundException: 'docs/spec/metadata.json' does not exist at C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\bin\Debug\netcoreapp2.1\specs\elastic\apm-server\7.x\docs/spec/metadata.json
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>    at Elastic.Apm.Specification.Validator.LoadSchemaAsync(String specificationId) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\src\Elastic.Apm.Specification\Validator.cs:line 203
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>    at Elastic.Apm.Tests.MockApmServer.Controllers.IntakeV2EventsController.<>c__DisplayClass10_0.<<ParsePayloadLineAndAddToReceivedData>g__HandleParsed|0>d`1.MoveNext() in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.Tests.MockApmServer\Controllers\IntakeV2EventsController.cs:line 139
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit> [2021-01-04 03:38:25.143 +00:00][Error] - {AspNetFullFramework.Tests.TestsBase} Reached max number of attempts to verify payload - Rethrowing the last exception...
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit> +-> Exception: Xunit.Sdk.XunitException: Expected receivedData.Transactions.Count to be 1, but found 0.
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>    at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>    at FluentAssertions.Execution.AssertionScope.FailWith(Func`1 failReasonFunc) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 181
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>    at FluentAssertions.Numeric.NumericAssertions`1.Be(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 50
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>    at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.VerifyReceivedDataSharedConstraints(SampleAppUrlPathData sampleAppUrlPathData, ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 512
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>    at Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests.MaxSpansAndSampleRateTests.<>c__DisplayClass8_1.<TestImpl>b__3(ReceivedData receivedData) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\CentralConfigTests.cs:line 262
[2021-01-04T03:38:30.869Z]  Elastic APM .NET Tests> 97> Xunit>    at Elastic.Apm.AspNetFullFramework.Tests.TestsBase.WaitAndCustomVerifyReceivedData(Action`1 verifyAction, Boolean shouldGatherDiagnostics) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\TestsBase.cs:line 360
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit> [2021-01-04 03:38:27.799 +00:00][Error] - {IntakeV2EventsController#3BC4427} Metadata #1 was parsed successfully but exception when validating against JSON schema.
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>     Input line (pretty formatted):
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>         {
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>             "metadata": {
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                 "service": {
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                     "agent": {
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                         "name": "dotnet",
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                         "version": "1.7.1"
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                     },
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                     "environment": "AspNetFullFramework_Tests_CentralConfigTests-CustomEnvironment",
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                     "framework": {
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                         "name": "ASP.NET",
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                         "version": "4.8.3928.0"
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                     },
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                     "language": {
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                         "name": "C#"
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                     },
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                     "name": "AspNetFullFramework_Tests_CentralConfigTests-CustomServiceName",
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                     "node": {},
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                     "runtime": {
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                         "name": ".NET Framework",
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                         "version": "4.8.4018.0"
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                     }
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                 },
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                 "system": {
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                     "detected_hostname": "kdl-apm-windows-2019",
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                     "hostname": "AspNetFullFramework_Tests_CentralConfigTests-CustomHostName"
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>                 }
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>             }
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>         }
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>     Parsed object:
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>         MetadataDto{Service: Service{Name: AspNetFullFramework_Tests_CentralConfigTests-CustomServiceName, Version: null, Environment: AspNetFullFramework_Tests_CentralConfigTests-CustomEnvironment, Runtime: Runtime{Name: .NET Framework, Version: 4.8.4018.0}, Framework: Framework{Name: ASP.NET, Version: 4.8.3928.0}, Agent: AgentC{Name: dotnet, Version: 1.7.1}, Language: Language{Name: C#}, Node: Node{ConfiguredName: null}}, System: System{Container: null, DetectedHostName: kdl-apm-windows-2019, HostName: AspNetFullFramework_Tests_CentralConfigTests-CustomHostName}, Labels: <null>}
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit> +-> Exception: System.IO.FileNotFoundException: 'docs/spec/metadata.json' does not exist at C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\bin\Debug\netcoreapp2.1\specs\elastic\apm-server\7.x\docs/spec/metadata.json
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>    at Elastic.Apm.Specification.Validator.LoadSchemaAsync(String specificationId) in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\src\Elastic.Apm.Specification\Validator.cs:line 203
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit>    at Elastic.Apm.Tests.MockApmServer.Controllers.IntakeV2EventsController.<>c__DisplayClass10_0.<<ParsePayloadLineAndAddToReceivedData>g__HandleParsed|0>d`1.MoveNext() in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.Tests.MockApmServer\Controllers\IntakeV2EventsController.cs:line 139
[2021-01-04T03:38:30.870Z]  Elastic APM .NET Tests> 97> Xunit> [2021-01-04 03:38:29.245 +00:00][Info] - {LoggingTestBase} Finished test: Elastic.Apm.AspNetFullFramework.Tests.CentralConfigTests+MaxSpansAndSampleRateTests.MaxSpans_invalid_value
[2021-01-04T03:38:30.870Z] 
[2021-01-04T03:38:30.870Z] 
[2021-01-04T03:38:30.870Z] 
[2021-01-04T03:38:30.870Z] JunitXML Logger - Results File: C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet\test\Elastic.Apm.AspNetFullFramework.Tests\junit-NETCoreApp21-Elastic.Apm.AspNetFullFramework.Tests.xml
[2021-01-04T03:38:30.870Z] 
[2021-01-04T03:38:30.870Z] Test Run Failed.
[2021-01-04T03:38:30.870Z] Total tests: 112
[2021-01-04T03:38:30.870Z]      Passed: 21
[2021-01-04T03:38:30.870Z]      Failed: 91
[2021-01-04T03:38:30.870Z]  Total time: 32.3968 Minutes
[2021-01-04T03:38:30.870Z] 
[2021-01-04T03:38:30.870Z] Build FAILED.
[2021-01-04T03:38:30.870Z]     0 Warning(s)
[2021-01-04T03:38:30.870Z]     0 Error(s)
[2021-01-04T03:38:30.870Z] 
[2021-01-04T03:38:30.870Z] Time Elapsed 00:32:25.07
[2021-01-04T03:38:31.737Z] Post stage
[2021-01-04T03:38:31.751Z] Running in C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-984\apm-agent-dotnet
[2021-01-04T03:38:31.774Z] Archiving artifacts
[2021-01-04T03:38:33.377Z] Recording test results
[2021-01-04T03:38:35.095Z] Post stage
[2021-01-04T03:38:35.119Z] [WS-CLEANUP] Deleting project workspace...
[2021-01-04T03:38:35.119Z] [WS-CLEANUP] Deferred wipeout is disabled by the job configuration...
[2021-01-04T03:38:39.655Z] [WS-CLEANUP] done
[2021-01-04T03:38:39.743Z] Failed in branch Windows .NET Framework
[2021-01-04T03:38:39.837Z] Stage "Release to feedz.io" skipped due to earlier failure(s)
[2021-01-04T03:38:39.878Z] Stage "Release" skipped due to earlier failure(s)
[2021-01-04T03:38:39.895Z] Stage "Release" skipped due to earlier failure(s)
[2021-01-04T03:38:39.938Z] Stage "Release" skipped due to earlier failure(s)
[2021-01-04T03:38:40.009Z] Stage "AfterRelease" skipped due to earlier failure(s)
[2021-01-04T03:38:40.029Z] Stage "AfterRelease" skipped due to earlier failure(s)
[2021-01-04T03:38:40.256Z] Running on Jenkins in /var/lib/jenkins/workspace/tnet_apm-agent-dotnet-mbp_PR-984
[2021-01-04T03:38:40.308Z] [INFO] getVaultSecret: Getting secrets
[2021-01-04T03:38:40.569Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2021-01-04T03:38:41.247Z] + chmod 755 generate-build-data.sh
[2021-01-04T03:38:41.247Z] + ./generate-build-data.sh https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-agent-dotnet/apm-agent-dotnet-mbp/PR-984/ https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-agent-dotnet/apm-agent-dotnet-mbp/PR-984/runs/24 FAILURE 4702194
[2021-01-04T03:38:41.498Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-agent-dotnet/apm-agent-dotnet-mbp/PR-984/runs/24/steps/?limit=10000 -o steps-info.json
[2021-01-04T03:38:42.048Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-agent-dotnet/apm-agent-dotnet-mbp/PR-984/runs/24/tests/?status=FAILED -o tests-errors.json

@russcam russcam force-pushed the feature/schema-validation branch from 22d28cb to 355ddd1 Compare October 22, 2020 02:25
@russcam russcam marked this pull request as ready for review October 22, 2020 06:31
@russcam
Copy link
Contributor Author

russcam commented Oct 22, 2020

As discussed with @gregkalapos, I've reverted the changes to the Agent types that transformed it into a complete reference implementation of the APM server schema specs. The validator still has the ability to perform this validation, with the test to perform this marked as skip for now.

This is now ready for review.

Copy link
Contributor

@gregkalapos gregkalapos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elastic/apm-server#4427 made some changes on where json files are. I tried to adapt this PR to the changes, but then I run into some NullReferenceExceptions.

But overall, this looks very nice! 👍

src/Elastic.Apm.Specification/Validator.cs Show resolved Hide resolved
src/Elastic.Apm/Api/IError.cs Outdated Show resolved Hide resolved
src/Elastic.Apm.Specification/Validator.cs Show resolved Hide resolved
@russcam russcam force-pushed the feature/schema-validation branch from 390ba31 to b2b83b1 Compare December 14, 2020 00:36
@gregkalapos gregkalapos self-requested a review December 22, 2020 21:02
@russcam russcam merged commit 8f3ca4b into elastic:master Jan 5, 2021
@russcam russcam deleted the feature/schema-validation branch January 5, 2021 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants