Commit Graph

34 Commits

Author SHA1 Message Date
Sebastian Poxhofer 05e1271376 test: use expect().resolves instead of awaiting inside expect (#45672)
Enables the vitest/prefer-expect-resolves oxlint rule and applies its
autofix across the spec suite.
2026-09-04 10:40:46 +00:00
Sebastian Poxhofer 2fc46bdcfa test(manager): replace file snapshots with explicit assertions (#45656)
* test(manager): replace file snapshots with explicit assertions

* test(manager): replace inline snapshots with explicit assertions

* test(manager): assert on relevant sections instead of full bodies

* test(manager): drop assertions implied by full equality

* test(manager): address review feedback

* test(manager): assert depType and versioning in the regex matcher
2026-09-04 06:36:39 +00:00
Sebastian Poxhofer fbedd41e82 test: replace env operation with vi.stubEnv() (#45490)
* test: replace manual process.env mutation with vi.stubEnv

Enable Vitest's `unstubEnvs` so env stubs are reverted automatically
before every test, and convert the manual `process.env.X = ...` /
`delete process.env.X` pairs in specs to `vi.stubEnv()`.

This removes the hand-written `afterEach` cleanup blocks and the
`const OLD_ENV = process.env` / `process.env = { ...OLD_ENV }`
save-restore dance, which silently leaked state between tests when a
test set a variable without a matching delete.

Left as-is (incompatible with `unstubEnvs`, which unstubs before each
test, not after):
- module top-level env writes (cocoapods, gomod, post-update, pip-compile
  and bundler artifacts specs)
- `beforeAll` env writes -- the two in `util/http` moved to `beforeEach`

* test: stop asserting on ambient environment variables

Three specs asserted on values that the surrounding environment can
override, so they only passed on a machine that happened not to set them:

- `util/exec/env`: `getChildProcessEnv()` forwards every entry of
  `basicEnvVars`, but the spec only seeded a subset. Any other forwarded
  variable that was set ambiently (e.g. a lowercase `http_proxy`) leaked
  into the `toEqual` assertion. Clear all of them first.
- `util/git/index`: `process.env.GIT_SSH_COMMAND` deliberately overrides
  the default that the two env-inheritance tests assert on. Clear it.
- `logger/pretty-stdout`: the colorized level strings are built at import
  time, so the `beforeEach` setting `FORCE_COLOR` could never affect them
  -- it was dead code, and the test silently assumed a terminal without
  colour support. Derive the expectation the same way the module does.

* test(datasource/nuget): use a throwaway cache dir for nupkg downloads

The `determine source URL from nupkg` tests do not mock the filesystem,
so they really wrote downloaded packages into a fixed `/tmp/cache` path.
That fails wherever the system tmpdir is not writable, and two checkouts
running the suite at once would share the same directory.

Use `tmp.dir({ unsafeCleanup: true })` and clean it up afterwards, which
is the pattern the other specs that touch disk already use.

* feat(lint): add renovate/prefer-stub-env rule

Enforces in specs what the migration to `vi.stubEnv` established:

- assigning to or deleting `process.env.X` inside `beforeEach`, `afterEach`,
  `it` or `test` is reported, with a fixer that rewrites it to `vi.stubEnv()`
- module scope, `describe` bodies and `beforeAll` / `afterAll` are left alone:
  `unstubEnvs` reverts stubs *before* each test, so a stub created there is
  gone by the time the first test runs, and those must keep assigning directly
- replacing the `process.env` object is reported everywhere and never fixed.
  `vi.stubEnv()` captures the original object when the worker starts, so after
  a reassignment its deletes silently target the old object

The rule found 28 further violations in specs the earlier sweep missed, since
that one was anchored on `delete process.env`. Twelve were auto-fixed; the
rest replaced `process.env` wholesale and are now `clearEnv()` from test/util.

`util/exec/index.spec.ts` opts out with a comment: it asserts on the whole
child env, and `vi.stubEnv()` cannot express that because it maps `PROD`,
`DEV` and `SSR` onto '' instead of deleting them.
2026-08-28 09:26:20 +00:00
Jonas Kuske 17a484aa21 fix(poetry): perform deepmerge to fully enrich projectDep with info from poetryDep (#43064)
* fix(poetry): perform deepmerge to fully enrich projectDep with info from poetryDep

previously, just additional `managerData` from the poetryDep was merged into the projectDep specification

* test(poetry): verify 'invalid-dependency-specification' if constraints specified twice
2026-05-04 07:16:20 +00:00
Jonas Kuske 0a9053b13c feat(poetry): enrich deps with managerData from poetry deps if both present (#39275)
* feat: use poetry deps to enrich equivalent pep621/pep735 deps

* test: cover project.optional-dependencies in enrichment test

* refactor: replace reduce usage with for..of loop

* refactor: use nullish-coalescing during variable assignment

* refactor: use coerceArray helper instead of nullish coalescing
2026-04-29 10:52:39 +00:00
Jonathan Berthias 00c5f809a8 feat(poetry): update build-system.requires dependencies (#40445)
feat(poetry): update build-system.requires dependencies
2026-03-19 09:37:33 +00:00
Sergei Zharinov 9d857c1f68 refactor(lint): Organize imports with biome (#40966) 2026-02-06 13:40:01 +00:00
Sergei Zharinov 930cf6633c refactor: Rewrite imports with .ts extensions (#40700)
fix: Additional vi.mock path corrections and prettier formatting
2026-01-26 22:48:17 +00:00
Jonas Kuske 1839f934e4 feat(poetry): support PEP735 dependency-groups (#38608)
* feat: support PEP735 dependency-groups in Poetry

* test: verify poetry pep735 dependency-groups extraction

* docs: add dependency-groups to supported poetry depTypes

* test: move poetry pep735 test to poetry v2 block
2025-11-10 10:41:50 +00:00
Sergei Zharinov 5f150439e2 feat(poetry): Support Poetry V2 (#37563) 2025-08-16 19:59:19 +00:00
Michael Kriese 19c115c813 test: cleanup (#34785) 2025-03-13 17:52:09 +00:00
Sergei Zharinov d2eb48d1a4 fix(poetry): Template keys handling (#34460)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2025-03-03 17:35:16 +00:00
Michael Kriese 997c23502e test: migrate to vitest (#34475)
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2025-02-26 09:35:54 +00:00
Sergei Zharinov 709e040839 feat: String utility for stripping templates (#34447) 2025-02-25 06:17:14 +00:00
Sigurd Spieckermann ff8c63ea04 fix(manager/poetry): fix schema for optional dependencies (#32096)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-10-30 19:19:44 +00:00
Sigurd Spieckermann e0fb1de479 fix(manager/poetry): set sourceName only if defined (#32162) 2024-10-27 13:48:21 +00:00
Johannes Feichtner 9e44136096 feat(manager/poetry): add support for git tag dependencies in non-GitHub repos (#27693) 2024-03-03 21:23:08 +00:00
Nam Vu 72fe67dd27 feat(manager/poetry): support git rev dependencies (#26367)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-01-04 08:48:39 +00:00
Johannes Feichtner 24f8f0dd88 feat(manager/poetry): add support for explicit sources (#26337) 2023-12-17 05:45:33 +00:00
Joshua Tang ce75693e3c fix(manager/poetry): use containerbase python as datasource (#24463) 2023-09-17 12:39:46 +00:00
Joshua Tang d56e156d03 feat(manager/poetry): extract python as a dependency from pyproject.toml (#24335) 2023-09-16 08:03:58 +00:00
Rhys Arkins 185f124e23 fix: Revert "feat(manager/poetry): extract python as a dependency from pyproject.toml" (#24257) 2023-09-06 04:32:01 +00:00
Joshua Tang 46c10be305 feat(manager/poetry): extract python as a dependency from pyproject.toml (#24236) 2023-09-04 15:17:25 +00:00
Sergei Zharinov 95d3a1db88 refactor(poetry): Use transforms for dependencies parsing (#23965) 2023-08-25 07:41:07 +00:00
Joshua Tang cec6faeaf6 refactor(manager/poetry): use zod schema validation (#23830) 2023-08-18 10:23:32 +00:00
Ion Alberdi 97c3ae93a6 feat(manager/poetry): Support tag as git-dependency on github (#21949) 2023-05-03 16:14:01 +00:00
dave-powell-kensho 74e592cd8c fix(poetry): normalize package name (#19807)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2023-01-14 06:35:30 +00:00
Braden Mars c4053802c5 feat: Support toml up to v1.0.0-rc.1 (#18670) 2022-11-01 06:16:13 +00:00
Mathieu Kniewallner 4c1b3e55a8 feat(poetry): handle dependency groups (#17964) 2022-10-06 05:01:48 +00:00
Michael Kriese b4319928f1 refactor: strict manager tests (#16155)
* refactor: strict manager tests

* chore: revert changes

* Update lib/modules/manager/gradle/extract.spec.ts
2022-06-20 17:05:39 +02:00
Hasan Awad 89facd1d5d feat: add extractedConstraint field for poetry (#15922)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2022-06-13 21:12:51 +00:00
Michael Kriese 6c7e79fbe3 refactor(manager): more strict null checks (#15166) 2022-04-19 17:46:07 +00:00
Michael Kriese 64f5bd5f03 test: enforce lint style rules (#15085) 2022-04-12 14:49:49 +00:00
Rhys Arkins dca3418bbd refactor: lib/modules (#14488)
Moves datasource, manager, platform and versioning code from lib/ into new lib/modules/

BREAKING CHANGE: External tools must update paths to datasource, manager, platform and versioning
2022-03-04 09:04:02 +01:00