-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🌱 Improve GitLab project e2e tests (#3324)
- Add e2e test for GitLab projects - Test Project details- GitLab: check if project is archived and get createdAt date Signed-off-by: naveensrinivasan <[email protected]>
- Loading branch information
1 parent
2e7d37a
commit 8779de9
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2023 OpenSSF Scorecard Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package gitlabrepo | ||
|
||
import ( | ||
"context" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("E2E TEST: gitlabrepo.Project", func() { | ||
Context("Test Project details- GitLab", func() { | ||
It("returns is project archived and createdAt", func() { | ||
repo, err := MakeGitlabRepo("https://gitlab.com/ossf-test/scorecard-check-branch-protection-e2e") | ||
Expect(err).Should(BeNil()) | ||
|
||
client, err := CreateGitlabClient(context.Background(), repo.Host()) | ||
Expect(err).Should(BeNil()) | ||
|
||
err = client.InitRepo(repo, "HEAD", 0) | ||
Expect(err).Should(BeNil()) | ||
archived, err := client.IsArchived() | ||
Expect(err).Should(BeNil()) | ||
Expect(archived).Should(BeFalse()) | ||
createdAt, err := client.GetCreatedAt() | ||
Expect(err).Should(BeNil()) | ||
Expect(createdAt).ShouldNot(BeNil()) | ||
}) | ||
}) | ||
}) |