Stop retrieving artifacts during unit test runs
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 328
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 9
Description
When running `make unit-test` some packages tests are attempting to download unreachable artifacts. In general, unit tests shouldn't be downloading resources. Some efforts were made to fix it that involved cross repository adjustments but got de-prioritized.
Given the failure has been present for quite some time, the test has been temporarily skipped until the issue is addressed.
#### Offending tests
```
TestPackageReaderReadChartsFromBundlesSuccess
TestPackageReaderReadImagesFromBundlesSuccess
```
#### Test output
_This output was after disabling one of the tests, grabbing the logging was an afterthought._
```
{"name":"harbor-test","source":{"repository":"","versions":[{"name":"0.0.1","digest":""},{"name":"0.0.2","di
gest":""}]}}
{"name":"harbor-test","source":{"repository":"","versions":[{"name":"0.0.1","digest":""},{"name":"0.0.2","di
gest":""}]}}
{"name":"harbor-test","source":{"repository":"","versions":[{"name":"0.0.1","digest":""},{"name":"0.0.2","di
gest":""}]}} {"name":"harbor-test","source":{"repository":"","versions":[{"name":"0.0.1","digest":""},{"name":"0.0.2","di
gest":""}]}}
-------------------------------------------------------------------------------------- The Amazon EKS Anywhere Curated Packages are only available to customers with the
Amazon EKS Anywhere Enterprise Subscription --------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------- The Amazon EKS Anywhere Curated Packages are only available to customers with the
Amazon EKS Anywhere Enterprise Subscription
-------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------
The Amazon EKS Anywhere Curated Packages are only available to customers with the Amazon EKS Anywhere Enterprise Subscription
--------------------------------------------------------------------------------------
time="2022-11-01T12:29:51-04:00" level=info msg="trying next host" error="failed to do request: Head \"https
://fake_registry/v2/fake_env/eks-anywhere-packages-bundles/manifests/v1-21-latest\": dial tcp: lookup fake_r
egistry: no such host" host=fake_registry --- FAIL: TestPackageReaderReadChartsFromBundlesSuccess (0.96s)
packagereader_test.go:134:
Expected
<[]v1alpha1.Image | len:0, cap:0>: []
not to be empty
time="2022-11-01T12:29:52-04:00" level=info msg="trying next host" error="failed to do request: Head \"https
://fake_registry/v2/fake_env/eks-anywhere-packages-bundles/manifests/v1-21-latest\": dial tcp: lookup fake_r
egistry: no such host" host=fake_registry FAIL
```
Contributor guide
Research direction
Run `make unit-test` and start with TestPackageReaderReadChartsFromBundlesSuccess and TestPackageReaderReadImagesFromBundlesSuccess, using packagereader_test.go:134 and the logged fake_registry request as entry points. Trace why these unit tests retrieve artifacts and check how the temporary skip is applied. Done means both tests pass without attempting network or artifact downloads.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100