Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

fix: use golangci-lint in favour of go-critic #550

Merged
merged 7 commits into from
Jan 4, 2021

Conversation

mdelapenya
Copy link
Contributor

@mdelapenya mdelapenya commented Jan 4, 2021

What does this PR do?

It replaces go-critic with golangci-lint, also adding go-vet (https://golang.org/cmd/vet/) and removing tomlv (no TOML files in the project) hooks.

In the process of testing each hook we identified minor flaws that we have fixed in this PR:

  • variable not used
  • deprecated type in a non-used file, which has been removed entirely
  • type not needed because it's inferred

Why is it important?

Go-critic fails to be fetched on CI (a clean environment) because its dependency to go-ruleguard seems to be broken after a package rename (See quasilyte/go-ruleguard#151).

Go-critic project also suggest using it under golangci-lint: https://github.com/go-critic/go-critic

For most users, using go-critic under golangci-lint is enough.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have run the Unit tests for the CLI, and they are passing locally
  • I have run the End-2-End tests for the suite I'm working on, and they are passing locally
  • I have noticed new Go dependencies (run make notice in the proper directory)

Author's Checklist

  • Run golint locally
  • Run golangci-lint locally
  • Run go vet locally

@mdelapenya mdelapenya self-assigned this Jan 4, 2021
@mdelapenya mdelapenya requested a review from a team January 4, 2021 13:32
@elasticmachine
Copy link
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

Expand to view the summary

Build stats

  • Build Cause: Pull request #550 opened

  • Start Time: 2021-01-04T13:32:43.015+0000

  • Duration: 35 min 2 sec

Test stats 🧪

Test Results
Failed 5
Passed 67
Skipped 20
Total 92

Test errors 5

Expand to view the tests failures

Initializing / End-To-End Tests / fleet_agent_endpoint_integration / Un-enrolling Elastic Agent stops Elastic Endpoint – Agent Endpoint Integration
    Expand to view the error details

     Step the host name is not shown in the Administration view in the Security App 
    

  • no stacktrace
Initializing / End-To-End Tests / fleet_fleet_mode_agent / Un-enrolling the centos agent – Fleet Mode Agent
    Expand to view the error details

     Step the "filebeat" process is in the "stopped" state on the host 
    

  • no stacktrace
Initializing / End-To-End Tests / fleet_fleet_mode_agent / Un-enrolling the debian agent – Fleet Mode Agent
    Expand to view the error details

     Step the "filebeat" process is in the "stopped" state on the host 
    

  • no stacktrace
Initializing / End-To-End Tests / fleet_fleet_mode_agent / Revoking the enrollment token for the centos agent – Fleet Mode Agent
    Expand to view the error details

     Step an attempt to enroll a new agent fails 
    

  • no stacktrace
Initializing / End-To-End Tests / fleet_fleet_mode_agent / Revoking the enrollment token for the debian agent – Fleet Mode Agent
    Expand to view the error details

     Step an attempt to enroll a new agent fails 
    

  • no stacktrace

Steps errors 5

Expand to view the steps failures

Run functional tests for fleet:agent_endpoint_integration
  • Took 23 min 34 sec . View more details on here
  • Description: .ci/scripts/functional-test.sh "fleet" "agent_endpoint_integration" "8.0.0-SNAPSHOT" "8.0.0-SNAPSHOT"
Archive the artifacts
  • Took 0 min 0 sec . View more details on here
  • Description: [2021-01-04T14:01:00.014Z] Archiving artifacts hudson.AbortException: script returned exit code 1
Run functional tests for fleet:fleet_mode_agent
  • Took 29 min 15 sec . View more details on here
  • Description: .ci/scripts/functional-test.sh "fleet" "fleet_mode_agent" "8.0.0-SNAPSHOT" "8.0.0-SNAPSHOT"
Archive the artifacts
  • Took 0 min 0 sec . View more details on here
  • Description: [2021-01-04T14:07:40.854Z] Archiving artifacts hudson.AbortException: script returned exit code 1
Error signal
  • Took 0 min 0 sec . View more details on here
  • Description: hudson.AbortException: script returned exit code 1

Log output

Expand to view the last 100 lines of log output

[2021-01-04T14:07:09.167Z] time="2021-01-04T14:07:09Z" level=debug msg="Agent listed in Fleet with online status" agentID=e5629970-4e95-11eb-8b30-0159c273940f hostname=30dc6b0ddc4b
[2021-01-04T14:07:09.167Z] time="2021-01-04T14:07:09Z" level=warning msg="The Agent is not in the offline status yet" agentID=e5629970-4e95-11eb-8b30-0159c273940f elapsedTime=1m39.070702653s hostname=30dc6b0ddc4b isAgentInStatus=false retry=24 status=offline
[2021-01-04T14:07:15.734Z] time="2021-01-04T14:07:15Z" level=debug msg="Agent listed in Fleet with online status" agentID=e5629970-4e95-11eb-8b30-0159c273940f hostname=30dc6b0ddc4b
[2021-01-04T14:07:15.734Z] time="2021-01-04T14:07:15Z" level=warning msg="The Agent is not in the offline status yet" agentID=e5629970-4e95-11eb-8b30-0159c273940f elapsedTime=1m45.573093318s hostname=30dc6b0ddc4b isAgentInStatus=false retry=25 status=offline
[2021-01-04T14:07:19.922Z] time="2021-01-04T14:07:19Z" level=debug msg="Agent listed in Fleet with online status" agentID=e5629970-4e95-11eb-8b30-0159c273940f hostname=30dc6b0ddc4b
[2021-01-04T14:07:19.922Z] time="2021-01-04T14:07:19Z" level=warning msg="The Agent is not in the offline status yet" agentID=e5629970-4e95-11eb-8b30-0159c273940f elapsedTime=1m49.426595088s hostname=30dc6b0ddc4b isAgentInStatus=false retry=26 status=offline
[2021-01-04T14:07:24.112Z] time="2021-01-04T14:07:23Z" level=debug msg="Agent listed in Fleet with online status" agentID=e5629970-4e95-11eb-8b30-0159c273940f hostname=30dc6b0ddc4b
[2021-01-04T14:07:24.112Z] time="2021-01-04T14:07:23Z" level=warning msg="The Agent is not in the offline status yet" agentID=e5629970-4e95-11eb-8b30-0159c273940f elapsedTime=1m53.74260647s hostname=30dc6b0ddc4b isAgentInStatus=false retry=27 status=offline
[2021-01-04T14:07:27.397Z] time="2021-01-04T14:07:27Z" level=debug msg="Agent listed in Fleet with online status" agentID=e5629970-4e95-11eb-8b30-0159c273940f hostname=30dc6b0ddc4b
[2021-01-04T14:07:27.397Z] time="2021-01-04T14:07:27Z" level=warning msg="The Agent is not in the offline status yet" agentID=e5629970-4e95-11eb-8b30-0159c273940f elapsedTime=1m57.351039433s hostname=30dc6b0ddc4b isAgentInStatus=false retry=28 status=offline
[2021-01-04T14:07:35.508Z] time="2021-01-04T14:07:34Z" level=debug msg="Agent listed in Fleet with online status" agentID=e5629970-4e95-11eb-8b30-0159c273940f hostname=30dc6b0ddc4b
[2021-01-04T14:07:35.508Z] time="2021-01-04T14:07:34Z" level=info msg="The Agent is in the desired status" elapsedTime=2m4.010710638s hostname=30dc6b0ddc4b isAgentInStatus=true retries=29 status=offline
[2021-01-04T14:07:35.508Z] time="2021-01-04T14:07:34Z" level=debug msg="Agent build hash found" commitFile=/elastic-agent/.elastic-agent.active.commit containerName=30dc6b0ddc4b hash=0f8b65eea63c7c13597c9c0d5a7bdb1be663cf8a shortHash=0f8b65
[2021-01-04T14:07:35.508Z] cat: /opt/Elastic/Agent/elastic-agent.log: No such file or directory
[2021-01-04T14:07:35.508Z] time="2021-01-04T14:07:35Z" level=error msg="Could not execute command in container" command="[cat /opt/Elastic/Agent/elastic-agent.log]" error="Could not run compose file: [/var/lib/jenkins/workspace/e2e-tests_e2e-testing-mbp_PR-550/.op/compose/profiles/fleet/docker-compose.yml /var/lib/jenkins/workspace/e2e-tests_e2e-testing-mbp_PR-550/.op/compose/services/debian-systemd/docker-compose.yml] - Local Docker compose exited abnormally whilst running docker-compose: [exec -T debian-systemd cat /opt/Elastic/Agent/elastic-agent.log]. exit status 1" service=debian-systemd
[2021-01-04T14:07:35.508Z] time="2021-01-04T14:07:35Z" level=error msg="Could not get agent logs in the container" command="[cat /opt/Elastic/Agent/elastic-agent.log]" containerName=30dc6b0ddc4b error="Could not run compose file: [/var/lib/jenkins/workspace/e2e-tests_e2e-testing-mbp_PR-550/.op/compose/profiles/fleet/docker-compose.yml /var/lib/jenkins/workspace/e2e-tests_e2e-testing-mbp_PR-550/.op/compose/services/debian-systemd/docker-compose.yml] - Local Docker compose exited abnormally whilst running docker-compose: [exec -T debian-systemd cat /opt/Elastic/Agent/elastic-agent.log]. exit status 1" hash=0f8b65
[2021-01-04T14:07:36.079Z] OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "elastic-agent": executable file not found in $PATH: unknown
[2021-01-04T14:07:36.079Z] time="2021-01-04T14:07:36Z" level=error msg="Could not execute command in container" command="[elastic-agent uninstall -f]" error="Could not run compose file: [/var/lib/jenkins/workspace/e2e-tests_e2e-testing-mbp_PR-550/.op/compose/profiles/fleet/docker-compose.yml /var/lib/jenkins/workspace/e2e-tests_e2e-testing-mbp_PR-550/.op/compose/services/debian-systemd/docker-compose.yml] - Local Docker compose exited abnormally whilst running docker-compose: [exec -T debian-systemd elastic-agent uninstall -f]. exit status 126" service=debian-systemd
[2021-01-04T14:07:36.079Z] time="2021-01-04T14:07:36Z" level=error msg="Could not run agent command in the box" command="[elastic-agent uninstall -f]" error="Could not run compose file: [/var/lib/jenkins/workspace/e2e-tests_e2e-testing-mbp_PR-550/.op/compose/profiles/fleet/docker-compose.yml /var/lib/jenkins/workspace/e2e-tests_e2e-testing-mbp_PR-550/.op/compose/services/debian-systemd/docker-compose.yml] - Local Docker compose exited abnormally whilst running docker-compose: [exec -T debian-systemd elastic-agent uninstall -f]. exit status 126" profile=fleet service=debian-systemd
[2021-01-04T14:07:36.079Z] time="2021-01-04T14:07:36Z" level=error msg="Could not uninstall the agent"
[2021-01-04T14:07:36.337Z] time="2021-01-04T14:07:36Z" level=debug msg="Un-enrolling agent in Fleet" agentID=e5629970-4e95-11eb-8b30-0159c273940f hostname=30dc6b0ddc4b
[2021-01-04T14:07:36.337Z] time="2021-01-04T14:07:36Z" level=error msg="Could unenroll agent" agentID=e5629970-4e95-11eb-8b30-0159c273940f body="{\"statusCode\":500,\"error\":\"Internal Server Error\",\"message\":\"x_content_parse_exception\"}" error="POST request failed with 500" url="http://localhost:5601/api/fleet/agents/e5629970-4e95-11eb-8b30-0159c273940f/unenroll"
[2021-01-04T14:07:36.337Z] time="2021-01-04T14:07:36Z" level=warning msg="The agentIDs for the hostname could not be unenrolled" err="POST request failed with 500" hostname=30dc6b0ddc4b
[2021-01-04T14:07:36.903Z] Stopping fleet_debian-systemd_elastic-agent_1 ... 
[2021-01-04T14:07:37.469Z] 
Stopping fleet_debian-systemd_elastic-agent_1 ... done
Removing fleet_debian-systemd_elastic-agent_1 ... 
[2021-01-04T14:07:37.469Z] 
Removing fleet_debian-systemd_elastic-agent_1 ... done
Going to remove fleet_debian-systemd_elastic-agent_1
[2021-01-04T14:07:37.728Z] time="2021-01-04T14:07:37Z" level=debug msg="Docker compose executed." cmd="[rm -fvs debian-systemd]" composeFilePaths="[/var/lib/jenkins/workspace/e2e-tests_e2e-testing-mbp_PR-550/.op/compose/profiles/fleet/docker-compose.yml /var/lib/jenkins/workspace/e2e-tests_e2e-testing-mbp_PR-550/.op/compose/services/debian-systemd/docker-compose.yml]" env="map[centos_systemdAgentBinarySrcPath:/tmp/elastic-agent-8.0.0-SNAPSHOT-linux-x86_64.tar.gz281268799 centos_systemdAgentBinaryTargetPath:/elastic-agent-8.0.0-SNAPSHOT-x86_64.tar.gz centos_systemdContainerName:fleet_centos-systemd_elastic-agent_1 centos_systemdTag:latest debian_systemdAgentBinarySrcPath:/tmp/elastic-agent-8.0.0-SNAPSHOT-linux-x86_64.tar.gz281268799 debian_systemdAgentBinaryTargetPath:/elastic-agent-8.0.0-SNAPSHOT-x86_64.tar.gz debian_systemdContainerName:fleet_debian-systemd_elastic-agent_1 debian_systemdTag:stretch kibanaConfigPath:/var/lib/jenkins/workspace/e2e-tests_e2e-testing-mbp_PR-550/src/github.com/elastic/e2e-testing/e2e/_suites/fleet/configurations/kibana.config.yml stackVersion:8.0.0-SNAPSHOT]" profile=fleet
[2021-01-04T14:07:37.728Z] time="2021-01-04T14:07:37Z" level=debug msg="Service removed from compose" profile=fleet service=debian-systemd
[2021-01-04T14:07:37.728Z] time="2021-01-04T14:07:37Z" level=error msg="Could not delete token" body="{\"statusCode\":500,\"error\":\"Internal Server Error\",\"message\":\"x_content_parse_exception\"}" error="DELETE request failed with 500" tokenID=e113d8c0-4e95-11eb-8b30-0159c273940f url="http://localhost:5601/api/fleet/enrollment-api-keys/e113d8c0-4e95-11eb-8b30-0159c273940f"
[2021-01-04T14:07:37.728Z] time="2021-01-04T14:07:37Z" level=warning msg="The enrollment token could not be deleted" err="DELETE request failed with 500" tokenID=e113d8c0-4e95-11eb-8b30-0159c273940f
[2021-01-04T14:07:37.728Z] time="2021-01-04T14:07:37Z" level=info msg="Integration deleted from the configuration" integration= packageConfigId= policyID=6cd06300-4e92-11eb-8b30-0159c273940f version=
[2021-01-04T14:07:37.728Z] time="2021-01-04T14:07:37Z" level=debug msg="Destroying Fleet runtime dependencies"
[2021-01-04T14:07:38.663Z] Stopping fleet_kibana_1           ... 
[2021-01-04T14:07:38.663Z] Stopping fleet_elasticsearch_1    ... 
[2021-01-04T14:07:38.663Z] Stopping fleet_package-registry_1 ... 
[2021-01-04T14:07:40.004Z] 
Stopping fleet_kibana_1           ... done

Stopping fleet_package-registry_1 ... done

Stopping fleet_elasticsearch_1    ... done
Removing fleet_kibana_1           ... 
[2021-01-04T14:07:40.004Z] Removing fleet_elasticsearch_1    ... 
[2021-01-04T14:07:40.004Z] Removing fleet_package-registry_1 ... 
[2021-01-04T14:07:40.004Z] 
Removing fleet_kibana_1           ... done

Removing fleet_package-registry_1 ... done

Removing fleet_elasticsearch_1    ... done
Removing network fleet_default
[2021-01-04T14:07:40.263Z] time="2021-01-04T14:07:40Z" level=debug msg="Docker compose executed." cmd="[down --remove-orphans]" composeFilePaths="[/var/lib/jenkins/workspace/e2e-tests_e2e-testing-mbp_PR-550/.op/compose/profiles/fleet/docker-compose.yml]" env="map[centos_systemdAgentBinarySrcPath:/tmp/elastic-agent-8.0.0-SNAPSHOT-linux-x86_64.tar.gz281268799 centos_systemdAgentBinaryTargetPath:/elastic-agent-8.0.0-SNAPSHOT-x86_64.tar.gz centos_systemdContainerName:fleet_centos-systemd_elastic-agent_1 centos_systemdTag:latest debian_systemdAgentBinarySrcPath:/tmp/elastic-agent-8.0.0-SNAPSHOT-linux-x86_64.tar.gz281268799 debian_systemdAgentBinaryTargetPath:/elastic-agent-8.0.0-SNAPSHOT-x86_64.tar.gz debian_systemdContainerName:fleet_debian-systemd_elastic-agent_1 debian_systemdTag:stretch kibanaConfigPath:/var/lib/jenkins/workspace/e2e-tests_e2e-testing-mbp_PR-550/src/github.com/elastic/e2e-testing/e2e/_suites/fleet/configurations/kibana.config.yml stackVersion:8.0.0-SNAPSHOT]" profile=fleet
[2021-01-04T14:07:40.263Z] time="2021-01-04T14:07:40Z" level=debug msg="Elastic Agent binary was removed." installer=centos-systemd path=/tmp/elastic-agent-8.0.0-SNAPSHOT-x86_64.rpm097636960
[2021-01-04T14:07:40.263Z] time="2021-01-04T14:07:40Z" level=debug msg="Elastic Agent binary was removed." installer=centos-tar path=/tmp/elastic-agent-8.0.0-SNAPSHOT-linux-x86_64.tar.gz281268799
[2021-01-04T14:07:40.263Z] time="2021-01-04T14:07:40Z" level=debug msg="Elastic Agent binary was removed." installer=debian-systemd path=/tmp/elastic-agent-8.0.0-SNAPSHOT-amd64.deb130525842
[2021-01-04T14:07:40.263Z] <?xml version="1.0" encoding="UTF-8"?>
[2021-01-04T14:07:40.263Z] <testsuites name="main" tests="18" skipped="0" failures="4" errors="0" time="1727.617304484">
[2021-01-04T14:07:40.263Z]   <testsuite name="Fleet Mode Agent" tests="18" skipped="0" failures="4" errors="0" time="1602.492426142">
[2021-01-04T14:07:40.263Z]     <testcase name="Deploying the centos agent" status="passed" time="39.132522195"></testcase>
[2021-01-04T14:07:40.263Z]     <testcase name="Deploying the debian agent" status="passed" time="21.426716086"></testcase>
[2021-01-04T14:07:40.263Z]     <testcase name="Deploying the centos agent with enroll and then run on rpm and deb" status="passed" time="24.455825887"></testcase>
[2021-01-04T14:07:40.263Z]     <testcase name="Deploying the debian agent with enroll and then run on rpm and deb" status="passed" time="44.474586405"></testcase>
[2021-01-04T14:07:40.263Z]     <testcase name="Stopping the centos agent stops backend processes" status="passed" time="9.405950393"></testcase>
[2021-01-04T14:07:40.263Z]     <testcase name="Stopping the debian agent stops backend processes" status="passed" time="11.72831971"></testcase>
[2021-01-04T14:07:40.263Z]     <testcase name="Restarting the installed centos agent" status="passed" time="19.44996983"></testcase>
[2021-01-04T14:07:40.263Z]     <testcase name="Restarting the installed debian agent" status="passed" time="124.397499078"></testcase>
[2021-01-04T14:07:40.263Z]     <testcase name="Restarting the centos host with persistent agent restarts backend processes" status="passed" time="26.628757351"></testcase>
[2021-01-04T14:07:40.263Z]     <testcase name="Restarting the debian host with persistent agent restarts backend processes" status="passed" time="20.353269811"></testcase>
[2021-01-04T14:07:40.263Z]     <testcase name="Un-enrolling the centos agent" status="failed" time="366.698443124">
[2021-01-04T14:07:40.263Z]       <failure message="Step the agent is listed in Fleet as &#34;inactive&#34;: The Agent is not in the inactive status yet"></failure>
[2021-01-04T14:07:40.263Z]       <error message="Step the &#34;filebeat&#34; process is in the &#34;stopped&#34; state on the host" type="skipped"></error>
[2021-01-04T14:07:40.263Z]       <error message="Step the &#34;metricbeat&#34; process is in the &#34;stopped&#34; state on the host" type="skipped"></error>
[2021-01-04T14:07:40.263Z]     </testcase>
[2021-01-04T14:07:40.263Z]     <testcase name="Un-enrolling the debian agent" status="failed" time="368.536370323">
[2021-01-04T14:07:40.263Z]       <failure message="Step the agent is listed in Fleet as &#34;inactive&#34;: The Agent is not in the inactive status yet"></failure>
[2021-01-04T14:07:40.263Z]       <error message="Step the &#34;filebeat&#34; process is in the &#34;stopped&#34; state on the host" type="skipped"></error>
[2021-01-04T14:07:40.263Z]       <error message="Step the &#34;metricbeat&#34; process is in the &#34;stopped&#34; state on the host" type="skipped"></error>
[2021-01-04T14:07:40.263Z]     </testcase>
[2021-01-04T14:07:40.263Z]     <testcase name="Re-enrolling the centos agent" status="passed" time="21.491924782"></testcase>
[2021-01-04T14:07:40.263Z]     <testcase name="Re-enrolling the debian agent" status="passed" time="45.835849631"></testcase>
[2021-01-04T14:07:40.263Z]     <testcase name="Revoking the enrollment token for the centos agent" status="failed" time="9.672345163">
[2021-01-04T14:07:40.263Z]       <failure message="Step the enrollment token is revoked: DELETE request failed with 500"></failure>
[2021-01-04T14:07:40.263Z]       <error message="Step an attempt to enroll a new agent fails" type="skipped"></error>
[2021-01-04T14:07:40.263Z]     </testcase>
[2021-01-04T14:07:40.263Z]     <testcase name="Revoking the enrollment token for the debian agent" status="failed" time="9.530373539">
[2021-01-04T14:07:40.263Z]       <failure message="Step the enrollment token is revoked: DELETE request failed with 500"></failure>
[2021-01-04T14:07:40.263Z]       <error message="Step an attempt to enroll a new agent fails" type="skipped"></error>
[2021-01-04T14:07:40.263Z]     </testcase>
[2021-01-04T14:07:40.263Z]     <testcase name="Un-installing the installed centos agent" status="passed" time="141.302910686"></testcase>
[2021-01-04T14:07:40.263Z]     <testcase name="Un-installing the installed debian agent" status="passed" time="134.970703449"></testcase>
[2021-01-04T14:07:40.263Z]   </testsuite>
[2021-01-04T14:07:40.263Z] </testsuites>make: *** [functional-test] Error 1
[2021-01-04T14:07:40.263Z] Makefile:59: recipe for target 'functional-test' failed
[2021-01-04T14:07:40.263Z] + echo 'ERROR: functional-test failed'
[2021-01-04T14:07:40.263Z] ERROR: functional-test failed
[2021-01-04T14:07:40.263Z] + exit_status=1
[2021-01-04T14:07:40.263Z] + sed -e 's/^[ \t]*//; s#>.*failed$#>#g' outputs/TEST-fleet
[2021-01-04T14:07:40.263Z] + grep -E '^<.*>$'
[2021-01-04T14:07:40.263Z] + exit 1
[2021-01-04T14:07:40.444Z] Recording test results
[2021-01-04T14:07:40.830Z] [Checks API] No suitable checks publisher found.
[2021-01-04T14:07:40.854Z] Archiving artifacts
[2021-01-04T14:07:40.975Z] Failed in branch fleet_fleet_mode_agent
[2021-01-04T14:07:42.367Z] Stage "Release" skipped due to earlier failure(s)
[2021-01-04T14:07:43.679Z] Running on worker-1244230 in /var/lib/jenkins/workspace/e2e-tests_e2e-testing-mbp_PR-550
[2021-01-04T14:07:43.743Z] [INFO] getVaultSecret: Getting secrets
[2021-01-04T14:07:43.812Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2021-01-04T14:07:45.976Z] + chmod 755 generate-build-data.sh
[2021-01-04T14:07:45.976Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/e2e-tests/e2e-testing-mbp/PR-550/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/e2e-tests/e2e-testing-mbp/PR-550/runs/1 FAILURE 2101574
[2021-01-04T14:07:45.976Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/e2e-tests/e2e-testing-mbp/PR-550/runs/1/steps/?limit=10000 -o steps-info.json
[2021-01-04T14:07:51.141Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/e2e-tests/e2e-testing-mbp/PR-550/runs/1/tests/?status=FAILED -o tests-errors.json
[2021-01-04T14:07:51.141Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/e2e-tests/e2e-testing-mbp/PR-550/runs/1/log/ -o pipeline-log.txt

🐛 Flaky test report

❕ There are test failures but not known flaky tests.

Expand to view the summary

Test stats 🧪

Test Results
Failed 5
Passed 67
Skipped 20
Total 92

Genuine test errors 5

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

  • Name: Initializing / End-To-End Tests / fleet_agent_endpoint_integration / Un-enrolling Elastic Agent stops Elastic Endpoint – Agent Endpoint Integration
  • Name: Initializing / End-To-End Tests / fleet_fleet_mode_agent / Un-enrolling the centos agent – Fleet Mode Agent
  • Name: Initializing / End-To-End Tests / fleet_fleet_mode_agent / Un-enrolling the debian agent – Fleet Mode Agent
  • Name: Initializing / End-To-End Tests / fleet_fleet_mode_agent / Revoking the enrollment token for the centos agent – Fleet Mode Agent
  • Name: Initializing / End-To-End Tests / fleet_fleet_mode_agent / Revoking the enrollment token for the debian agent – Fleet Mode Agent

@mdelapenya mdelapenya marked this pull request as ready for review January 4, 2021 14:17
@mdelapenya
Copy link
Contributor Author

The errors are also existing in master, so not related. Going to merge

@mdelapenya
Copy link
Contributor Author

mdelapenya commented Jan 4, 2021

Did not mentioned here, but those errors seems related to a change in elasticsearch/kibana:

It feels that kibana/elasticsearch are not creating Fleet setup throwing/raising an x_content_parse_exception:

In tests:

ERRO[2021-01-04T07:38:24+01:00] Could not check Kibana setup for Fleet responseBody="{"statusCode":500,"error":"Internal Server Error","message":"x_content_parse_exception"}"

In Kibana logs:

{"type":"log","@timestamp":"2021-01-04T06:38:24+00:00","tags":["error","plugins","fleet"],"pid":8,"message":"ResponseError: x_content_parse_exception\n at onBody (/usr/share/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:333:23)\n at IncomingMessage.onEnd (/usr/share/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:260:11)\n at IncomingMessage.emit (events.js:327:22)\n at endReadableNT (internal/streams/readable.js:1327:12)\n at processTicksAndRejections (internal/process/task_queues.js:80:21) {\n meta: {\n body: { error: [Object], status: 400 },\n statusCode: 400,\n headers: {\n 'content-type': 'application/json; charset=UTF-8',\n 'content-length': '265'\n },\n meta: {\n context: null,\n request: [Object],\n name: 'elasticsearch-js',\n connection: [Object],\n attempts: 0,\n aborted: false\n }\n }\n}"}

For a similar reason, any try to unenroll an agent fails with similar error:
In Tests:

ERRO[2021-01-04T07:39:41+01:00] Could unenroll agent agentID=818d6260-4e57-11eb-a61c-1f9d22248156 body="{"statusCode":500,"error":"Internal Server Error","message":"x_content_parse_exception"}" error="POST request failed with 500" url="http://localhost:5601/api/fleet/agents/818d6260-4e57-11eb-a61c-1f9d22248156/unenroll"

In Kibana logs:

{"type":"log","@timestamp":"2021-01-04T06:39:41+00:00","tags":["error","plugins","security","authentication","api-key"],"pid":8,"message":"Failed to invalidate API key as current user: x_content_parse_exception"}

Would this PR be related? elastic/kibana#87053. Also reported by Kibana QA here: elastic/kibana#86864

@mdelapenya mdelapenya merged commit 600c6ac into elastic:master Jan 4, 2021
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request Jan 4, 2021
* fix: remove var type as per golint's suggestion

* chore: add golangci-lint precommit hook

* chore: remove go-critic in fafvour of golangci-lint

* chore: remove TOML hook

* chore: add go-vet hook

* fix: remove unused variable

Detected by golangci-lint

* fix: remove unused Go file, which caused lint errors
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request Jan 4, 2021
* fix: remove var type as per golint's suggestion

* chore: add golangci-lint precommit hook

* chore: remove go-critic in fafvour of golangci-lint

* chore: remove TOML hook

* chore: add go-vet hook

* fix: remove unused variable

Detected by golangci-lint

* fix: remove unused Go file, which caused lint errors
mdelapenya added a commit that referenced this pull request Jan 4, 2021
…use golangci-lint in favour of go-critic (#550) backport for 7.x (#553)

* chore: simplify jUnit format generation with gotestsum (#549)

* fix: use golangci-lint in favour of go-critic (#550)

* fix: remove var type as per golint's suggestion

* chore: add golangci-lint precommit hook

* chore: remove go-critic in fafvour of golangci-lint

* chore: remove TOML hook

* chore: add go-vet hook

* fix: remove unused variable

Detected by golangci-lint

* fix: remove unused Go file, which caused lint errors
mdelapenya added a commit that referenced this pull request Jan 4, 2021
…use golangci-lint in favour of go-critic (#550) backport for 7.10.x (#554)

* chore: simplify jUnit format generation with gotestsum (#549)

* fix: use golangci-lint in favour of go-critic (#550)

* fix: remove var type as per golint's suggestion

* chore: add golangci-lint precommit hook

* chore: remove go-critic in fafvour of golangci-lint

* chore: remove TOML hook

* chore: add go-vet hook

* fix: remove unused variable

Detected by golangci-lint

* fix: remove unused Go file, which caused lint errors
@mdelapenya mdelapenya mentioned this pull request Jan 4, 2021
12 tasks
@mdelapenya mdelapenya deleted the golang-precommit-hooks branch January 4, 2021 18:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants