Skip to content

Remove pkg errors from beats#31622

Closed
cmacknz wants to merge 23 commits intoelastic:mainfrom
cmacknz:remove-pkg-errors
Closed

Remove pkg errors from beats#31622
cmacknz wants to merge 23 commits intoelastic:mainfrom
cmacknz:remove-pkg-errors

Conversation

@cmacknz
Copy link
Copy Markdown
Member

@cmacknz cmacknz commented May 12, 2022

Remove every use of github.com/pkg/errors in favor of the standard library's errors package.

Use https://github.com/xdg-go/go-rewrap-errors to attempt to automatically port to the Go standard library's error packages.

Draft. Do not review until CI passes.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 12, 2022
@botelastic
Copy link
Copy Markdown

botelastic bot commented May 12, 2022

This pull request doesn't have a Team:<team> label.

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 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: 2022-05-12T20:18:48.740+0000

  • Duration: 151 min 14 sec

Test stats 🧪

Test Results
Failed 33
Passed 20297
Skipped 1099
Total 21429

Test errors 33

Expand to view the tests failures

> Show only the first 10 test failures

Build&Test / x-pack/functionbeat-windows-2022-windows-2022 / TestRunnable/propagate_functions_errors_to_the_coordinator – github.com/elastic/beats/v7/x-pack/functionbeat/function/provider
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestRunnable/propagate_functions_errors_to_the_coordinator
        provider_test.go:61: 
            	Error Trace:	provider_test.go:61
            	Error:      	Not equal: 
            	            	expected: *errors.errorString(&errors.errorString{s:"function error"})
            	            	actual  : <nil>(<nil>)
            	Test:       	TestRunnable/propagate_functions_errors_to_the_coordinator
        --- FAIL: TestRunnable/propagate_functions_errors_to_the_coordinator (0.00s)
     
    

Build&Test / x-pack/functionbeat-windows-2022-windows-2022 / TestRunnable – github.com/elastic/beats/v7/x-pack/functionbeat/function/provider
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestRunnable
    --- FAIL: TestRunnable (0.00s)
     
    

Build&Test / x-pack/functionbeat-windows-2016-windows-2016 / TestRunnable/propagate_functions_errors_to_the_coordinator – github.com/elastic/beats/v7/x-pack/functionbeat/function/provider
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestRunnable/propagate_functions_errors_to_the_coordinator
        provider_test.go:61: 
            	Error Trace:	provider_test.go:61
            	Error:      	Not equal: 
            	            	expected: *errors.errorString(&errors.errorString{s:"function error"})
            	            	actual  : <nil>(<nil>)
            	Test:       	TestRunnable/propagate_functions_errors_to_the_coordinator
        --- FAIL: TestRunnable/propagate_functions_errors_to_the_coordinator (0.00s)
     
    

Build&Test / x-pack/functionbeat-windows-2016-windows-2016 / TestRunnable – github.com/elastic/beats/v7/x-pack/functionbeat/function/provider
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestRunnable
    --- FAIL: TestRunnable (0.00s)
     
    

Build&Test / x-pack/libbeat-unitTest / TestClientCacheWrap – github.com/elastic/beats/v7/x-pack/libbeat/common/cloudfoundry
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestClientCacheWrap
        cache_test.go:42: 
            	Error Trace:	cache_test.go:42
            	Error:      	Should be true
            	Test:       	TestClientCacheWrap
        cache_test.go:48: 
            	Error Trace:	cache_test.go:48
            	Error:      	Should be true
            	Test:       	TestClientCacheWrap
    --- FAIL: TestClientCacheWrap (2.05s)
     
    

Build&Test / x-pack/functionbeat-unitTest / TestRunnable/propagate_functions_errors_to_the_coordinator – github.com/elastic/beats/v7/x-pack/functionbeat/function/provider
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestRunnable/propagate_functions_errors_to_the_coordinator
        provider_test.go:61: 
            	Error Trace:	provider_test.go:61
            	Error:      	Not equal: 
            	            	expected: *errors.errorString(&errors.errorString{s:"function error"})
            	            	actual  : <nil>(<nil>)
            	Test:       	TestRunnable/propagate_functions_errors_to_the_coordinator
        --- FAIL: TestRunnable/propagate_functions_errors_to_the_coordinator (0.00s)
     
    

Build&Test / x-pack/functionbeat-unitTest / TestRunnable – github.com/elastic/beats/v7/x-pack/functionbeat/function/provider
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestRunnable
    --- FAIL: TestRunnable (0.00s)
     
    

Build&Test / libbeat-unitTest / TestNetworkCreate/all_options – github.com/elastic/beats/v7/libbeat/conditions
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestNetworkCreate/all_options
        network_test.go:102: 
            	Error Trace:	network_test.go:102
            	Error:      	Received unexpected error:
            	            	failed to parse CIDR, values must be an IP address and prefix length, like '192.0.2.0/24' or '2001:db8::/32', as defined in RFC 4632 and RFC 4291.: %!w(<nil>)
            	Test:       	TestNetworkCreate/all_options
        --- FAIL: TestNetworkCreate/all_options (0.00s)
     
    

Build&Test / libbeat-unitTest / TestNetworkCreate – github.com/elastic/beats/v7/libbeat/conditions
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestNetworkCreate
    --- FAIL: TestNetworkCreate (0.00s)
     
    

Build&Test / libbeat-unitTest / TestNetworkCheck/match_loopback – github.com/elastic/beats/v7/libbeat/conditions
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestNetworkCheck/match_loopback
        network_test.go:137: 
            	Error Trace:	conditions_test.go:112
            	            				network_test.go:137
            	Error:      	Received unexpected error:
            	            	failed to parse CIDR, values must be an IP address and prefix length, like '192.0.2.0/24' or '2001:db8::/32', as defined in RFC 4632 and RFC 4291.: %!w(<nil>)
            	Test:       	TestNetworkCheck/match_loopback
        --- FAIL: TestNetworkCheck/match_loopback (0.00s)
     
    

Steps errors 47

Expand to view the steps failures

Show only the first 10 steps failures

x-pack/libbeat-unitTest - mage build unitTest
  • Took 3 min 59 sec . View more details here
  • Description: mage build unitTest
x-pack/libbeat-unitTest - mage build unitTest
  • Took 1 min 28 sec . View more details here
  • Description: mage build unitTest
x-pack/libbeat-unitTest - mage build unitTest
  • Took 1 min 56 sec . View more details here
  • Description: mage build unitTest
x-pack/metricbeat-windows-2022-windows-2022 - mage build unitTest
  • Took 3 min 15 sec . View more details here
  • Description: mage build unitTest
x-pack/metricbeat-windows-2022-windows-2022 - mage build unitTest
  • Took 0 min 26 sec . View more details here
  • Description: mage build unitTest
x-pack/metricbeat-windows-2022-windows-2022 - mage build unitTest
  • Took 0 min 26 sec . View more details here
  • Description: mage build unitTest
x-pack/metricbeat-windows-2016-windows-2016 - mage build unitTest
  • Took 3 min 10 sec . View more details here
  • Description: mage build unitTest
x-pack/metricbeat-windows-2016-windows-2016 - mage build unitTest
  • Took 1 min 58 sec . View more details here
  • Description: mage build unitTest
x-pack/metricbeat-windows-2016-windows-2016 - mage build unitTest
  • Took 1 min 19 sec . View more details here
  • Description: mage build unitTest
Error signal
  • Took 0 min 0 sec . View more details here
  • Description: Error 'hudson.AbortException: script returned exit code 1'

🐛 Flaky test report

❕ There are test failures but not known flaky tests.

Expand to view the summary

Genuine test errors 33

💔 There are test failures but not known flaky tests, most likely a genuine test failure.

  • Name: Build&Test / x-pack/functionbeat-windows-2022-windows-2022 / TestRunnable/propagate_functions_errors_to_the_coordinator – github.com/elastic/beats/v7/x-pack/functionbeat/function/provider
  • Name: Build&Test / x-pack/functionbeat-windows-2022-windows-2022 / TestRunnable – github.com/elastic/beats/v7/x-pack/functionbeat/function/provider
  • Name: Build&Test / x-pack/functionbeat-windows-2016-windows-2016 / TestRunnable/propagate_functions_errors_to_the_coordinator – github.com/elastic/beats/v7/x-pack/functionbeat/function/provider
  • Name: Build&Test / x-pack/functionbeat-windows-2016-windows-2016 / TestRunnable – github.com/elastic/beats/v7/x-pack/functionbeat/function/provider
  • Name: Build&Test / x-pack/libbeat-unitTest / TestClientCacheWrap – github.com/elastic/beats/v7/x-pack/libbeat/common/cloudfoundry
  • Name: Build&Test / x-pack/functionbeat-unitTest / TestRunnable/propagate_functions_errors_to_the_coordinator – github.com/elastic/beats/v7/x-pack/functionbeat/function/provider
  • Name: Build&Test / x-pack/functionbeat-unitTest / TestRunnable – github.com/elastic/beats/v7/x-pack/functionbeat/function/provider
  • Name: Build&Test / libbeat-unitTest / TestNetworkCreate/all_options – github.com/elastic/beats/v7/libbeat/conditions
  • Name: Build&Test / libbeat-unitTest / TestNetworkCreate – github.com/elastic/beats/v7/libbeat/conditions
  • Name: Build&Test / libbeat-unitTest / TestNetworkCheck/match_loopback – github.com/elastic/beats/v7/libbeat/conditions
  • Name: Build&Test / libbeat-unitTest / TestNetworkCheck/negative_match – github.com/elastic/beats/v7/libbeat/conditions
  • Name: Build&Test / libbeat-unitTest / TestNetworkCheck/multiple_fields_match – github.com/elastic/beats/v7/libbeat/conditions
  • Name: Build&Test / libbeat-unitTest / TestNetworkCheck/multiple_fields_negative_match – github.com/elastic/beats/v7/libbeat/conditions
  • Name: Build&Test / libbeat-unitTest / TestNetworkCheck – github.com/elastic/beats/v7/libbeat/conditions
  • Name: Build&Test / libbeat-unitTest / TestNetworkContains – github.com/elastic/beats/v7/libbeat/conditions
  • Name: Build&Test / metricbeat-unitTest / TestData – github.com/elastic/beats/v7/metricbeat/module/system/socket
  • Name: Build&Test / metricbeat-unitTest / TestFetch – github.com/elastic/beats/v7/metricbeat/module/system/socket
  • Name: Build&Test / libbeat-goIntegTest / TestNetworkCreate/all_options – github.com/elastic/beats/v7/libbeat/conditions
  • Name: Build&Test / libbeat-goIntegTest / TestNetworkCreate – github.com/elastic/beats/v7/libbeat/conditions
  • Name: Build&Test / libbeat-goIntegTest / TestNetworkCheck/match_loopback – github.com/elastic/beats/v7/libbeat/conditions
  • Name: Build&Test / libbeat-goIntegTest / TestNetworkCheck/negative_match – github.com/elastic/beats/v7/libbeat/conditions
  • Name: Build&Test / libbeat-goIntegTest / TestNetworkCheck/multiple_fields_match – github.com/elastic/beats/v7/libbeat/conditions
  • Name: Build&Test / libbeat-goIntegTest / TestNetworkCheck/multiple_fields_negative_match – github.com/elastic/beats/v7/libbeat/conditions
  • Name: Build&Test / libbeat-goIntegTest / TestNetworkCheck – github.com/elastic/beats/v7/libbeat/conditions
  • Name: Build&Test / libbeat-goIntegTest / TestNetworkContains – github.com/elastic/beats/v7/libbeat/conditions
  • Name: Build&Test / metricbeat-goIntegTest / TestData – github.com/elastic/beats/v7/metricbeat/module/ceph/mgr_cluster_disk
  • Name: Build&Test / metricbeat-goIntegTest / TestData – github.com/elastic/beats/v7/metricbeat/module/ceph/mgr_cluster_health
  • Name: Build&Test / metricbeat-goIntegTest / TestData – github.com/elastic/beats/v7/metricbeat/module/ceph/mgr_osd_perf
  • Name: Build&Test / metricbeat-goIntegTest / TestData – github.com/elastic/beats/v7/metricbeat/module/ceph/mgr_osd_pool_stats
  • Name: Build&Test / metricbeat-goIntegTest / TestData – github.com/elastic/beats/v7/metricbeat/module/ceph/mgr_osd_tree
  • Name: Build&Test / metricbeat-goIntegTest / TestData – github.com/elastic/beats/v7/metricbeat/module/ceph/mgr_pool_disk
  • Name: Build&Test / metricbeat-goIntegTest / TestData – github.com/elastic/beats/v7/metricbeat/module/system/socket
  • Name: Build&Test / metricbeat-goIntegTest / TestFetch – github.com/elastic/beats/v7/metricbeat/module/system/socket

🤖 GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented May 16, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b remove-pkg-errors upstream/remove-pkg-errors
git merge upstream/main
git push upstream remove-pkg-errors

@cmacknz cmacknz closed this May 17, 2022
@cmacknz cmacknz deleted the remove-pkg-errors branch May 17, 2022 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs_team Indicates that the issue/PR needs a Team:* label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants