-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Include GitLab subgroups #6546
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
Include GitLab subgroups #6546
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/** | ||
* Copyright (c) 2021 Gitpod GmbH. All rights reserved. | ||
* Licensed under the GNU Affero General Public License (AGPL). | ||
* See License-AGPL.txt in the project root for license information. | ||
*/ | ||
|
||
import * as chai from 'chai'; | ||
import { suite, test } from 'mocha-typescript'; | ||
import { RepoURL } from './repo-url'; | ||
|
||
const expect = chai.expect; | ||
|
||
@suite | ||
export class RepoUrlTest { | ||
|
||
@test public parseRepoUrl() { | ||
const testUrl = RepoURL.parseRepoUrl("https://gitlab.com/hello-group/my-cool-project.git") | ||
expect(testUrl).to.deep.equal({ | ||
host: 'gitlab.com', | ||
owner: 'hello-group', | ||
repo: 'my-cool-project' | ||
}); | ||
} | ||
|
||
@test public parseSubgroupOneLevel() { | ||
const testUrl = RepoURL.parseRepoUrl("https://gitlab.com/hello-group/my-subgroup/my-cool-project.git") | ||
expect(testUrl).to.deep.equal({ | ||
host: 'gitlab.com', | ||
owner: 'hello-group/my-subgroup', | ||
repo: 'my-cool-project' | ||
}); | ||
} | ||
|
||
@test public parseSubgroupTwoLevels() { | ||
const testUrl = RepoURL.parseRepoUrl("https://gitlab.com/hello-group/my-subgroup/my-sub-subgroup/my-cool-project.git") | ||
expect(testUrl).to.deep.equal({ | ||
host: 'gitlab.com', | ||
owner: 'hello-group/my-subgroup/my-sub-subgroup', | ||
repo: 'my-cool-project' | ||
}); | ||
} | ||
|
||
@test public parseSubgroupThreeLevels() { | ||
const testUrl = RepoURL.parseRepoUrl( | ||
"https://gitlab.com/hello-group/my-subgroup/my-sub-subgroup/my-sub-sub-subgroup/my-cool-project.git") | ||
expect(testUrl).to.deep.equal({ | ||
host: 'gitlab.com', | ||
owner: 'hello-group/my-subgroup/my-sub-subgroup/my-sub-sub-subgroup', | ||
repo: 'my-cool-project' | ||
}); | ||
} | ||
|
||
@test public parseSubgroupFourLevels() { | ||
const testUrl = RepoURL.parseRepoUrl( | ||
"https://gitlab.com/hello-group/my-subgroup/my-sub-subgroup/my-sub-sub-subgroup/my-sub-sub-sub-subgroup/my-cool-project.git") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue(non-blocking): Cross-posting from #5362 (comment) to bring this up again, although sounds ok to leave this out of the scope of this PR, in case we'd like to make plan any action:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd love to answer but I'm not sure I know what this question or this context means, even after reading the issue. Maybe something I can ask about in the next team call? Also cc-ing @JanKoehnlein in case he has context. |
||
expect(testUrl).to.deep.equal({ | ||
host: 'gitlab.com', | ||
owner: 'hello-group/my-subgroup/my-sub-subgroup/my-sub-sub-subgroup/my-sub-sub-sub-subgroup', | ||
repo: 'my-cool-project' | ||
}); | ||
} | ||
|
||
} | ||
|
||
module.exports = new RepoUrlTest() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise: Thanks for adding these tests here, @laushinka! 🌟
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks to @svenefftinge for the reminder to write more tests :)