-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests to check 'Azure DevOps' provider in PR checks (#552)
* Add tests to check git-flow on 'azure-devops' git-provider * Refactor methods * Upfdate tests * Update 'pat-secret.yaml' file * Update the '.ci/openshift-ci/Dockerfile' * Exclude 'testFactoryResolverNoPatOAuth' from the test * Fix variable name * Refactor '<testClone>' methods to handle errors more informative
- Loading branch information
Showing
6 changed files
with
113 additions
and
21 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
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
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,32 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2023 Red Hat, Inc. | ||
# This program and the accompanying materials are made | ||
# available under the terms of the Eclipse Public License 2.0 | ||
# which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
# Contributors: | ||
# Red Hat, Inc. - initial API and implementation | ||
# | ||
|
||
# exit immediately when a command fails | ||
set -ex | ||
# only exit with zero if all commands of the pipeline exit successfully | ||
set -o pipefail | ||
|
||
export PUBLIC_REPO_URL=${PUBLIC_REPO_URL:-"https://[email protected]/chepullreq1/che-pr-public/_git/public-repo"} | ||
export PRIVATE_REPO_URL=${PRIVATE_REPO_URL:-"https://dev.azure.com/chepullreq1/che-pr-private/_git/private-repo"} | ||
|
||
# import common test functions | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
source "${SCRIPT_DIR}"/common.sh | ||
|
||
trap "catchFinish" EXIT SIGINT | ||
|
||
setupTestEnvironment ${OCP_NON_ADMIN_USER_NAME} | ||
# due to the issue https://github.com/eclipse/che/issues/22469 | ||
# testFactoryResolverNoPatOAuth ${PUBLIC_REPO_URL} ${PRIVATE_REPO_URL} | ||
testClonePublicRepoNoPatOAuth ${PUBLIC_REPO_WORKSPACE_NAME} ${PUBLIC_PROJECT_NAME} ${PUBLIC_REPO_URL} ${USER_CHE_NAMESPACE} | ||
testClonePrivateRepoNoPatOAuth ${PRIVATE_REPO_WORKSPACE_NAME} ${PRIVATE_PROJECT_NAME} ${PRIVATE_REPO_URL} ${USER_CHE_NAMESPACE} |
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,41 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2023 Red Hat, Inc. | ||
# This program and the accompanying materials are made | ||
# available under the terms of the Eclipse Public License 2.0 | ||
# which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
# Contributors: | ||
# Red Hat, Inc. - initial API and implementation | ||
# | ||
|
||
# exit immediately when a command fails | ||
set -ex | ||
# only exit with zero if all commands of the pipeline exit successfully | ||
set -o pipefail | ||
|
||
export PUBLIC_REPO_URL=${PUBLIC_REPO_URL:-"https://[email protected]/chepullreq1/che-pr-public/_git/public-repo"} | ||
export PRIVATE_REPO_URL=${PRIVATE_REPO_URL:-"https://dev.azure.com/chepullreq1/che-pr-private/_git/private-repo"} | ||
export GIT_PROVIDER_TYPE=${GIT_PROVIDER_TYPE:-"azure-devops"} | ||
export GIT_PROVIDER_URL=${GIT_PROVIDER_URL:-"https://dev.azure.com"} | ||
|
||
# import common test functions | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
source "${SCRIPT_DIR}"/common.sh | ||
|
||
trap "catchFinish" EXIT SIGINT | ||
|
||
setupTestEnvironment ${OCP_NON_ADMIN_USER_NAME} | ||
setupPersonalAccessToken ${GIT_PROVIDER_TYPE} ${GIT_PROVIDER_URL} ${AZURE_PAT} | ||
requestProvisionNamespace | ||
testFactoryResolverWithPatOAuth ${PUBLIC_REPO_URL} ${PRIVATE_REPO_URL} | ||
echo "[INFO] Check clone public repository with PAT setup" | ||
testCloneGitRepoWithSetupPat ${PUBLIC_REPO_WORKSPACE_NAME} ${PUBLIC_PROJECT_NAME} ${PUBLIC_REPO_URL} ${USER_CHE_NAMESPACE} | ||
testGitCredentialsData ${USER_CHE_NAMESPACE} ${AZURE_PAT} ${GIT_PROVIDER_URL} | ||
deleteTestWorkspace ${PUBLIC_REPO_WORKSPACE_NAME} ${USER_CHE_NAMESPACE} | ||
echo "[INFO] Check clone private repository with PAT setup" | ||
testCloneGitRepoWithSetupPat ${PRIVATE_REPO_WORKSPACE_NAME} ${PRIVATE_PROJECT_NAME} ${PRIVATE_REPO_URL} ${USER_CHE_NAMESPACE} | ||
testGitCredentialsData ${USER_CHE_NAMESPACE} ${AZURE_PAT} ${GIT_PROVIDER_URL} | ||
deleteTestWorkspace ${PRIVATE_REPO_WORKSPACE_NAME} ${USER_CHE_NAMESPACE} |
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
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