Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(maven): Refactor datasource tests #9745

Merged
merged 7 commits into from Apr 27, 2021

Conversation

zharinov
Copy link
Collaborator

Changes:

Use and track HTTP/file mocks instead of relying on file protocol support being used to obtain fixtures.

Context:

Ref: #6742

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added unit tests, or
  • No new tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@zharinov zharinov marked this pull request as draft April 27, 2021 13:43
import nock from 'nock';
import { Release, getPkgReleases } from '..';
import { getName, loadFixture } from '../../../test/util';
import _fs from 'fs-extra';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the code using our utils/fs wrapper?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't work since maven/util.ts uses fs-extra directly

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, so needs refactored /fixed in separate pr.

@zharinov zharinov marked this pull request as ready for review April 27, 2021 13:54
Sergei Zharinov added 2 commits April 27, 2021 17:15
@@ -339,7 +339,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate",
},
"method": "GET",
"url": "https://repo.maven.apache.org/maven2/org/example/package/maven-metadata.xml",
"url": "http://repo.maven.apache.org/maven2/org/example/package/maven-metadata.xml",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentionally replaced https to http for this test. I needed to fix coverage and this test seemed pretty relevant for this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead, probably it would be better to remove HTTP support at all

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't removing HTTP support break support for internal maven repositories that aren't served via HTTPS?
Like sonatype nexus for example still comes out of the box with http as it's default port.
Other scenarios might see some old references to http:// where the server properly handles a 301 to https

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right

@rarkins rarkins enabled auto-merge (squash) April 27, 2021 20:52
@rarkins rarkins merged commit 1d7a984 into renovatebot:main Apr 27, 2021
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 25.4.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2021
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

5 participants