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

fix: run unit tests after refactor#1067

Merged
adam-stokes merged 7 commits intoelastic:masterfrom
mdelapenya:refactor-leftovers
Apr 21, 2021
Merged

fix: run unit tests after refactor#1067
adam-stokes merged 7 commits intoelastic:masterfrom
mdelapenya:refactor-leftovers

Conversation

@mdelapenya
Copy link
Copy Markdown
Contributor

What does this PR do?

It moves test resources from the original location before the refactor to the new location under the internal (we could use the root dir too. wdyt?)

Besides that it updates the automation to run the unit tests, both locally with Make and in the CI.

Why is it important?

We lost the unit tests (see https://beats-ci.elastic.co/blue/organizations/jenkins/e2e-tests%2Fe2e-testing-mbp/detail/PR-1008/44/pipeline/106)

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/Internal, 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

make unit-test

Related issues

@mdelapenya mdelapenya self-assigned this Apr 21, 2021
@mdelapenya mdelapenya requested a review from a team April 21, 2021 16:17
@adam-stokes
Copy link
Copy Markdown
Contributor

It moves test resources from the original location before the refactor to the new location under the internal (we could use the root dir too. wdyt?)

I think this makes sense, the _testresources is only useful for our internal testing of the code?

@mdelapenya
Copy link
Copy Markdown
Contributor Author

I think this makes sense, the _testresources is only useful for our internal testing of the code?

Yes, it's only used in the internal package, although it could be eventually useful for unit test in the cli one. OTOH, we could be moving code from cli to internal

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 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: Pull request #1067 opened

  • Start Time: 2021-04-21T16:17:20.718+0000

  • Duration: 41 min 21 sec

  • Commit: a757e70

Test stats 🧪

Test Results
Failed 0
Passed 142
Skipped 0
Total 142

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 142
Skipped 0
Total 142

@adam-stokes adam-stokes marked this pull request as ready for review April 21, 2021 17:02
@adam-stokes adam-stokes merged commit 249fd97 into elastic:master Apr 21, 2021
mergify bot pushed a commit that referenced this pull request Apr 21, 2021
* chore: remove unused files after refactor

* chore: run unit tests with new layout

* fix: run unit tests on CI

* chore: include unit tests for the e2e dir

* fix: move unit tests resources for installer tests

* fix: move more test resources for unit tests

* fix: abstract path calculation from OS

(cherry picked from commit 249fd97)

# Conflicts:
#	Makefile
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-8.0.0-SNAPSHOT-amd64.deb
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-8.0.0-SNAPSHOT-linux-amd64.tar.gz
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-8.0.0-SNAPSHOT-x86_64.rpm
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-ubi8-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz
#	cli/_testresources/gcp/commits.json
#	cli/_testresources/gcp/nextPageParam.json
#	cli/_testresources/gcp/snapshots.json
#	e2e/Makefile
andrewstucki pushed a commit that referenced this pull request Apr 21, 2021
* chore: remove unused files after refactor

* chore: run unit tests with new layout

* fix: run unit tests on CI

* chore: include unit tests for the e2e dir

* fix: move unit tests resources for installer tests

* fix: move more test resources for unit tests

* fix: abstract path calculation from OS

(cherry picked from commit 249fd97)

# Conflicts:
#	Makefile
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-8.0.0-SNAPSHOT-amd64.deb
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-8.0.0-SNAPSHOT-linux-amd64.tar.gz
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-8.0.0-SNAPSHOT-x86_64.rpm
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-ubi8-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz
#	cli/_testresources/gcp/commits.json
#	cli/_testresources/gcp/nextPageParam.json
#	cli/_testresources/gcp/snapshots.json
#	e2e/Makefile
andrewstucki pushed a commit that referenced this pull request Apr 21, 2021
* chore: remove unused files after refactor

* chore: run unit tests with new layout

* fix: run unit tests on CI

* chore: include unit tests for the e2e dir

* fix: move unit tests resources for installer tests

* fix: move more test resources for unit tests

* fix: abstract path calculation from OS

(cherry picked from commit 249fd97)

# Conflicts:
#	Makefile
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-8.0.0-SNAPSHOT-amd64.deb
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-8.0.0-SNAPSHOT-linux-amd64.tar.gz
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-8.0.0-SNAPSHOT-x86_64.rpm
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-ubi8-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz
#	cli/_testresources/gcp/commits.json
#	cli/_testresources/gcp/nextPageParam.json
#	cli/_testresources/gcp/snapshots.json
#	e2e/Makefile
andrewstucki pushed a commit that referenced this pull request Apr 22, 2021
* chore: remove unused files after refactor

* chore: run unit tests with new layout

* fix: run unit tests on CI

* chore: include unit tests for the e2e dir

* fix: move unit tests resources for installer tests

* fix: move more test resources for unit tests

* fix: abstract path calculation from OS

(cherry picked from commit 249fd97)

# Conflicts:
#	Makefile
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-8.0.0-SNAPSHOT-amd64.deb
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-8.0.0-SNAPSHOT-linux-amd64.tar.gz
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-8.0.0-SNAPSHOT-x86_64.rpm
#	cli/_testresources/beats/x-pack/elastic-agent/build/distributions/elastic-agent-ubi8-8.0.0-SNAPSHOT-linux-amd64.docker.tar.gz
#	cli/_testresources/gcp/commits.json
#	cli/_testresources/gcp/nextPageParam.json
#	cli/_testresources/gcp/snapshots.json
#	e2e/Makefile
@mdelapenya mdelapenya deleted the refactor-leftovers branch April 22, 2021 08:43
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request Apr 22, 2021
* chore: remove unused files after refactor

* chore: run unit tests with new layout

* fix: run unit tests on CI

* chore: include unit tests for the e2e dir

* fix: move unit tests resources for installer tests

* fix: move more test resources for unit tests

* fix: abstract path calculation from OS
@mdelapenya mdelapenya mentioned this pull request Apr 22, 2021
9 tasks
mdelapenya added a commit that referenced this pull request Apr 22, 2021
* cli: enable loading default profiles turnkey (#943)

* cli: enable loading default profiles turnkey

Fixes #933
* update NOTICE
* Fix additional lint issues in ingest_manager_test
* Cleanup comment and trace log in GetComposeFile
* Provide better trace feedback if missing docker-compose
* Update cli/config/config.go
* chore: add back traces when extracting the files from the box (#946)
* fix: use a more comprehensive initialisation method for configs
   As go init() method is not deterministic, I found that the logger init was
   not called at the right time. With change we ensure that the Init is:
   1) called first
   2) existing it the config was already populated
* chore: add back traces when extracting the files from the box

Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>

* Add basic check on correct service is defined for profile runs (#957)

Fixes #944

This adds a length check on the string split for verifying that the
<service/image name>:<tag> is defined when adding additional services to a
profile deployment.

Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>

* Update NOTICE (#969)

Adds additional overrides to pulling in the proper licenses

Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>

* Build binaries via goreleaser (#977)

This handles building for all supported architectures including running packr
for embedding the binary files.

This allows us to easily extend our release process for tagging official cli
releases, building in various package formats and publishing to different
package registries

Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>

* chore: simplify release process on Jenkins (#980)

* chore: archive releases in Jenkins UI

* chore: simplify release process on Jenkins

* chore: remove garbage

* chore: support retrying fetching the goreleaser script

It will also retry in the case the release command fails

* chore: set GITHUB_TOKEN

* chore: ensure workspace is clean in the worker

* chore: add release information for goreleaser

* Remove the agent config file parameters for stand alone (#983)

Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>

* fix: run unit tests after refactor (#1067)

* chore: remove unused files after refactor

* chore: run unit tests with new layout

* fix: run unit tests on CI

* chore: include unit tests for the e2e dir

* fix: move unit tests resources for installer tests

* fix: move more test resources for unit tests

* fix: abstract path calculation from OS

Co-authored-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request Apr 23, 2021
* master:
  fix: run unit tests after refactor (elastic#1067)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants