-
Notifications
You must be signed in to change notification settings - Fork 3
Alioss Integration Tests Migration to Github Worfklow #9
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
Merged
stephanme
merged 14 commits into
cloudfoundry:main
from
sap-contributions:feature/alioss-integration-tests
Nov 21, 2025
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
754c3e0
feat: alioss github workflow is added
serdarozerr 34c5067
fix: workflow name added, file name corrected. Readme updated
serdarozerr 996a733
fix: profile var is removed
serdarozerr 3f23835
docs: typo corrected
serdarozerr 0bc9458
feat: bucket exist function added
serdarozerr b8f2f3d
feat: bucket delete check added
serdarozerr 4965bbf
feat: integration tests are run successfully
serdarozerr a3c4106
feat: aliyun cli action added
serdarozerr 479ec77
fix: environment tag removed from workflow
serdarozerr 9ae3090
fix: pr path added for workflow
serdarozerr a70fbf9
fix: copilot reviews are fixed
serdarozerr 9aaa13a
docs: run location clarified
serdarozerr a4a3cba
docs: run location for unit tests added
serdarozerr 40fb65a
feat: push main and manual trigger are added
serdarozerr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,27 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| script_dir="$( cd "$(dirname "${0}")" && pwd )" | ||
| repo_root="$(cd "${script_dir}/../../.." && pwd)" | ||
|
|
||
| : "${access_key_id:?}" | ||
| : "${access_key_secret:?}" | ||
| : "${test_name:=general}" | ||
| : "${region:=eu-central-1}" | ||
|
|
||
| export ACCESS_KEY_ID="${access_key_id}" | ||
| export ACCESS_KEY_SECRET="${access_key_secret}" | ||
| export ENDPOINT="oss-${region}.aliyuncs.com" | ||
|
|
||
| pushd "${script_dir}" > /dev/null | ||
| source utils.sh | ||
| bucket_name="$(read_bucket_name_from_file "${test_name}")" | ||
| : "${bucket_name:?}" | ||
| export BUCKET_NAME="${bucket_name}" | ||
| popd > /dev/null | ||
|
|
||
| pushd "${repo_root}" > /dev/null | ||
| echo -e "\n running tests with $(go version)..." | ||
| ginkgo -r alioss/integration/ | ||
| popd > /dev/null | ||
|
|
This file contains hidden or 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,26 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| script_dir="$( cd "$(dirname "${0}")" && pwd )" | ||
| repo_root="$(cd "${script_dir}/../../.." && pwd)" | ||
|
|
||
|
|
||
|
|
||
| : "${access_key_id:?}" | ||
| : "${access_key_secret:?}" | ||
| : "${test_name:=general}" | ||
| : "${region:=eu-central-1}" | ||
|
|
||
|
|
||
| export ALI_ACCESS_KEY_ID="${access_key_id}" | ||
| export ALI_ACCESS_KEY_SECRET="${access_key_secret}" | ||
| export ALI_REGION="${region}" | ||
|
|
||
|
|
||
|
|
||
| pushd "${script_dir}" | ||
| source utils.sh | ||
| generate_bucket_name "${test_name}" | ||
| aliyun_configure | ||
| create_bucket "${test_name}" | ||
| popd |
This file contains hidden or 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,27 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| script_dir="$( cd "$(dirname "${0}")" && pwd )" | ||
| repo_root="$(cd "${script_dir}/../../.." && pwd)" | ||
|
|
||
|
|
||
| : "${access_key_id:?}" | ||
| : "${access_key_secret:?}" | ||
| : "${test_name:=general}" | ||
| : "${region:=eu-central-1}" | ||
|
|
||
| export ALI_ACCESS_KEY_ID="${access_key_id}" | ||
| export ALI_ACCESS_KEY_SECRET="${access_key_secret}" | ||
| export ALI_REGION="${region}" | ||
|
|
||
|
|
||
|
|
||
| pushd "${script_dir}" | ||
| source utils.sh | ||
| aliyun_configure | ||
| if delete_bucket "${test_name}" ; then | ||
| delete_bucket_name_file "${test_name}" | ||
| else | ||
| exit 1 | ||
| fi | ||
| popd |
This file contains hidden or 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,80 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| TMP_DIR="/tmp/storage-cli-alioss-${GITHUB_RUN_ID:-${USER}}" | ||
|
|
||
| # generate a random bucket name with "alioss-" prefix | ||
| function random_name { | ||
| echo "alioss-$(openssl rand -hex 20)" | ||
| } | ||
|
|
||
|
|
||
| # create a file with .lock suffix and store the bucket name inside it | ||
| function generate_bucket_name { | ||
| local file_name="${1}.lock" | ||
| local bucket_name="$(random_name)" | ||
| mkdir -p "${TMP_DIR}" | ||
| echo "${bucket_name}" > "${TMP_DIR}/${file_name}" | ||
| } | ||
|
|
||
|
|
||
| # retrieve the bucket name from the .lock file | ||
| function read_bucket_name_from_file { | ||
| local file_name="$1" | ||
| cat "${TMP_DIR}/${file_name}.lock" | ||
| } | ||
|
|
||
| # delete the .lock file | ||
| function delete_bucket_name_file { | ||
| local file_name="$1" | ||
| rm -f "${TMP_DIR}/${file_name}.lock" | ||
| } | ||
|
|
||
|
|
||
| function aliyun_configure { | ||
| aliyun configure set --access-key-id "$ALI_ACCESS_KEY_ID" \ | ||
| --access-key-secret "$ALI_ACCESS_KEY_SECRET" \ | ||
| --region "$ALI_REGION" | ||
| } | ||
|
|
||
| function bucket_exists { | ||
| local bucket_name="$1" | ||
| if aliyun oss ls | grep -w "oss://${bucket_name}" > /dev/null 2>&1; then | ||
| return 0 | ||
| else | ||
| return 1 | ||
| fi | ||
| } | ||
|
|
||
| function create_bucket { | ||
| local bucket_name="$(read_bucket_name_from_file "$1")" | ||
|
|
||
| if aliyun oss mb "oss://$bucket_name" 2>/dev/null; then | ||
| echo "Bucket ${bucket_name} created successfully" | ||
| else | ||
| if bucket_exists "${bucket_name}"; then | ||
| echo "Bucket ${bucket_name} already exists" | ||
| return 0 | ||
| else | ||
| echo "Failed to create bucket ${bucket_name}" | ||
| return 1 | ||
| fi | ||
| fi | ||
|
|
||
| } | ||
|
|
||
|
|
||
| function delete_bucket { | ||
| local bucket_name="$(read_bucket_name_from_file "$1")" | ||
|
|
||
| if aliyun oss rm "oss://${bucket_name}" -b -r -f 2>/dev/null; then | ||
| echo "Bucket ${bucket_name} deleted successfully" | ||
| else | ||
| if bucket_exists "${bucket_name}"; then | ||
| echo "ERROR: Failed to delete bucket ${bucket_name}" | ||
| return 1 | ||
| else | ||
| echo "Bucket ${bucket_name} already deleted or doesn't exist" | ||
| fi | ||
| fi | ||
| return 0 | ||
| } |
This file contains hidden or 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,42 @@ | ||
| name: Alioss Integration Tests | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| paths: | ||
| - ".github/workflows/alioss-integration.yml" | ||
| - "alioss/**" | ||
| push: | ||
| branches: | ||
| - main | ||
| jobs: | ||
| alioss-general-integration-tests: | ||
| name: Alioss General Integration Tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
| - name: Set up Go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: go.mod | ||
| - name: Set up Aliyun CLI | ||
| uses: aliyun/setup-aliyun-cli-action@v1 | ||
| - name: Install Ginkgo | ||
| run: go install github.com/onsi/ginkgo/v2/ginkgo@latest | ||
| - name: Setup Alioss Test Environment | ||
| run: | | ||
| export access_key_id="${{ secrets.ALI_ACCESS_KEY_ID }}" | ||
| export access_key_secret="${{ secrets.ALI_ACCESS_KEY_SECRET }}" | ||
| ./.github/scripts/alioss/setup.sh | ||
| - name: Run Tests | ||
| run: | | ||
| export access_key_id="${{ secrets.ALI_ACCESS_KEY_ID }}" | ||
| export access_key_secret="${{ secrets.ALI_ACCESS_KEY_SECRET }}" | ||
| ./.github/scripts/alioss/run-int.sh | ||
| - name: Teardown Alioss Test Environment | ||
| if: always() | ||
| run: | | ||
| export access_key_id="${{ secrets.ALI_ACCESS_KEY_ID }}" | ||
| export access_key_secret="${{ secrets.ALI_ACCESS_KEY_SECRET }}" | ||
| ./.github/scripts/alioss/teardown.sh | ||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.