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

fix: honor ELASTIC_AGENT_VERSION when downloading the agent #480

Merged
merged 2 commits into from
Dec 1, 2020

Conversation

mdelapenya
Copy link
Contributor

@mdelapenya mdelapenya commented Nov 30, 2020

What does this PR do?

It checks if the environment variable used to override Agent's version is set. If it's not set, then it will use the base version, which is obtained from:

a. the Elastic Artifacts URL for aliases (7.x, 7.10.x),
b. fixed to the maintenance branch
c. 8.0.0-SNAPSHOT in the master branch

Why is it important?

I found that running:

SUITE="fleet" \
    TAGS="fleet_mode && enroll" DEVELOPER_MODE=true \
    TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE \
    ELASTIC_AGENT_VERSION="7.10.1" \
    make -C e2e functional-test

was always downloading the version set to the maintenance branch, not honoring the version set in the environment variable.

Because we evaluated the version just once (init method for the test suite), then further calculations were tied to thee base version.

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)

How to test this PR locally

Download a different agent version (7.10.1)

git checkout master
SUITE="fleet" \
    TAGS="fleet_mode && enroll" DEVELOPER_MODE=true \
    TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE \
    ELASTIC_AGENT_VERSION="7.10.1" \
    make -C e2e functional-test

Download the default agent version (8.0.0-SNAPSHOT)

git checkout master
SUITE="fleet" \
    TAGS="fleet_mode && enroll" DEVELOPER_MODE=true \
    TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE \
    make -C e2e functional-test

Related issues

Sorry, something went wrong.

@mdelapenya mdelapenya self-assigned this Nov 30, 2020
@mdelapenya mdelapenya requested a review from a team November 30, 2020 20:38
@mdelapenya
Copy link
Contributor Author

jenkins run the tests please

@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 30, 2020

💚 Build Succeeded

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: Started by user Manuel de la Peña

  • Start Time: 2020-12-01T07:35:25.776+0000

  • Duration: 23 min 39 sec

Test stats 🧪

Test Results
Failed 0
Passed 70
Skipped 20
Total 90

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 70
Skipped 20
Total 90

@mdelapenya mdelapenya marked this pull request as ready for review December 1, 2020 09:45
@mdelapenya
Copy link
Contributor Author

No need to backport this to 7.9.x, as the TAR installer support is not available in that maintenance branch

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.

None yet

4 participants