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

application-package: remove unused test #8295

Merged
merged 4 commits into from
Aug 4, 2020

Conversation

vince-fugnitto
Copy link
Member

What it does

Fixes: #8285

The following pull-request removes the ExtensionPackage#isOutdated method along with it's unit test.

Motivation

  • the method isOutdated is no longer used (no callers present in the repo)
  • the unit test fails intermittently as it depends on npm (which is not ideal for a test case)

How to test

Verify that CI successfully passes.

Review checklist

Reminder for reviewers

Signed-off-by: vince-fugnitto vincent.fugnitto@ericsson.com

@vince-fugnitto vince-fugnitto added quality issues related to code and application quality test issues related to unit and api tests labels Aug 3, 2020
@vince-fugnitto vince-fugnitto self-assigned this Aug 3, 2020
the following commit removes the method `isOutdated` from
`ExtensionPackage` along with it's unit-test as it is deprecated and
no longer used.

Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

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

Thank you!

@kittaakos
Copy link
Contributor

async getLatestVersion(): Promise<string | undefined> {
        const raw = await this.view();
        return raw.latestVersion;
    }

    protected versionRange?: string;
    async getVersionRange(): Promise<string | undefined> {
        if (this.versionRange === undefined) {
            this.versionRange = await this.resolveVersionRange();
        }
        return this.versionRange;
    }
    protected async resolveVersionRange(): Promise<string | undefined> {
        const version = this.raw.version;
        const validVersion = semver.valid(version);
        if (validVersion) {
            return validVersion;
        }
        const validRange = semver.validRange(version);
        if (validRange) {
            return validRange;
        }
        const raw = await this.view();
        return raw.tags ? raw.tags[version] : undefined;
    }

can be also removed.

The following commit removes the `ExtensionPackage.getLatestVersion`
method as it is unused and untested.

Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
The following commit removes the `getVersionRange` method which
is currently unused and untested.

Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
The following commit removes the method `resolveVersionRange`
which is unused and untested.

Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
@vince-fugnitto
Copy link
Member Author

can be also removed.

Thank you! I've removed the unused code in my latest changes.

Copy link
Contributor

@marcdumais-work marcdumais-work left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Vince

@vince-fugnitto vince-fugnitto merged commit f4884f7 into master Aug 4, 2020
@vince-fugnitto vince-fugnitto deleted the vf/extension-package-tests branch August 4, 2020 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
quality issues related to code and application quality test issues related to unit and api tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] isOutdated test failing intermittently. 10s timeout too short?
3 participants