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

fix(gitea): pagination #5798

Merged
merged 4 commits into from
Mar 27, 2020
Merged

Conversation

NateScarlet
Copy link
Contributor

Closes #5797

Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

Please add test case

@NateScarlet
Copy link
Contributor Author

I have difficulties to setup test environment. Can someone write test for me?
image

@viceice
Copy link
Member

viceice commented Mar 27, 2020

Did you checked: docs/development/local-development.md ?

@NateScarlet
Copy link
Contributor Author

PS D:\~\src\github.com\NateScarlet\renovate> git --version
git version 2.20.1.windows.1
PS D:\~\src\github.com\NateScarlet\renovate> node --version
v12.16.1
PS D:\~\src\github.com\NateScarlet\renovate> yarn --version
1.22.4
PS D:\~\src\github.com\NateScarlet\renovate> python --version
Python 2.7.17
PS D:\~\src\github.com\NateScarlet\renovate> python -c "import mock; print(mock.__version__)"
3.0.5
PS D:\~\src\github.com\NateScarlet\renovate> java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

@viceice
Copy link
Member

viceice commented Mar 27, 2020

can you add the test log, the failed snapshots? whats the difference

@NateScarlet
Copy link
Contributor Author

  ● workers/repository/process/lookup › .lookupUpdates() › ignores deprecated

    expect(received).toMatchSnapshot()

    Snapshot name: `workers/repository/process/lookup .lookupUpdates() ignores deprecated 1`

    - Snapshot  - 19
    + Received  +  2

      Object {
        "changelogUrl": undefined,
    -   "deprecationMessage": "On registry `https://registry.npmjs.org/`, the \"latest\" version (v1.4.1) of dependency `q2` has the following deprecation notice:
    -
    - `true`
    -
    - Marking the latest version of an npm package as deprecated results in the entire package being
considered deprecated, so contact the package author you think this is a mistake.",
        "homepage": undefined,
    -   "sourceUrl": "https://github.com/kriskowal/q",
    -   "updates": Array [
    -     Object {
    -       "canBeUnpublished": false,
    -       "fromVersion": "1.3.0",
    -       "isSingleVersion": true,
    -       "newMajor": 1,
    -       "newMinor": 4,
    -       "newValue": "1.4.0",
    -       "releaseTimestamp": "2015-05-09T16:52:40.699Z",
    -       "toVersion": "1.4.0",
    -       "updateType": "minor",
    -     },
    -   ],
    +   "sourceUrl": null,
    +   "updates": Array [],
        "warnings": Array [],
      }

      1060 |         .reply(200, returnJson);
      1061 |       const res = await lookup.lookupUpdates(config);
    > 1062 |       expect(res).toMatchSnapshot();
           |                   ^
      1063 |       expect(res.updates[0].toVersion).toEqual('1.4.0');
      1064 |     });
      1065 |     it('is deprecated', async () => {

      at Object.<anonymous> (lib/workers/repository/process/lookup/index.spec.ts:1062:19)

  ● workers/repository/process/lookup › .lookupUpdates() › is deprecated

    expect(received).toMatchSnapshot()

    Snapshot name: `workers/repository/process/lookup .lookupUpdates() is deprecated 1`

    - Snapshot  - 16
    + Received  +  3

      Object {
        "changelogUrl": undefined,
    -   "homepage": undefined,
    -   "sourceDirectory": "test",
    -   "sourceUrl": "https://github.com/kriskowal/q",
    -   "updates": Array [
    -     Object {
    -       "canBeUnpublished": false,
    -       "fromVersion": "1.3.0",
    -       "isSingleVersion": true,
    -       "newMajor": 1,
    -       "newMinor": 4,
    -       "newValue": "1.4.1",
    -       "releaseTimestamp": "2015-05-17T04:25:07.299Z",
    -       "toVersion": "1.4.1",
    -       "updateType": "minor",
    -     },
    -   ],
    +   "homepage": "http://drarmstr.github.io/c3/",
    +   "sourceUrl": "https://github.com/drarmstr/c3",
    +   "updates": Array [],
        "warnings": Array [],
      }

      1078 |         .reply(200, returnJson);
      1079 |       const res = await lookup.lookupUpdates(config);
    > 1080 |       expect(res).toMatchSnapshot();
           |                   ^
      1081 |       expect(res.updates[0].toVersion).toEqual('1.4.1');
      1082 |     });
      1083 |     it('skips unsupported values', async () => {

      at Object.<anonymous> (lib/workers/repository/process/lookup/index.spec.ts:1080:19)

There is too many logs, i just post this two.

@NateScarlet
Copy link
Contributor Author

Maybe these tests fail because i am in china , and i have to use mirror for almost all pacakge manager.

@viceice
Copy link
Member

viceice commented Mar 27, 2020

the test should work fully offline 🤔

@NateScarlet
Copy link
Contributor Author

I found i can just run jest test for a folder. So i will just let ci do the full test.

@viceice
Copy link
Member

viceice commented Mar 27, 2020

you can event test a single .spec.ts

Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

Just some test cleanup / simplification

lib/platform/gitea/gitea-got-wrapper.spec.ts Show resolved Hide resolved
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

LGTM

@rarkins rarkins changed the title fix: gitea pagination fix(gitea): pagination Mar 27, 2020
@rarkins rarkins merged commit f00846e into renovatebot:master Mar 27, 2020
ViralRuparel pushed a commit to ViralRuparel/renovate that referenced this pull request Mar 29, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
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.

Gitea: wrong pagination handling
3 participants