Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 113 additions & 12 deletions .github/workflows/tests-integration-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
default: ${{ vars.SHEPHERD_POOL_NAME }}
pool-namespace:
type: string
default: 'tas-devex'
default: 'official'
is-pr:
type: boolean
default: true
Expand Down Expand Up @@ -62,6 +62,13 @@ jobs:
repository: cloudfoundry/cli-ci
path: cli-ci

- name: Checkout cf-acceptance-tests
uses: actions/checkout@v4
with:
repository: cloudfoundry/cf-acceptance-tests
ref: release-candidate
path: cf-acceptance-tests

- id: read-min-capi
name: Read MIN CAPI
run: |
Expand Down Expand Up @@ -100,16 +107,16 @@ jobs:
run: |
shepherd login service-account ${account_token}

echo "shepherd create lease --duration 8h --pool ${pool_name} --pool-namespace tas-devex --namespace ${pool_namespace}"
lease_id=$(shepherd create lease --duration 8h --pool ${pool_name} --pool-namespace tas-devex --namespace ${pool_namespace} --json | jq -r .id)
echo "shepherd create lease --duration 8h --pool ${pool_name} --pool-namespace ${pool_namespace} --namespace tas-devex"
lease_id=$(shepherd create lease --duration 8h --pool ${pool_name} --pool-namespace ${pool_namespace} --namespace tas-devex --json | jq -r .id)
# Give sometime for the lease to complete. Shepherd may take upto an 3 hours to create an env
# if the pool is empty.
count=0
while [ $count -lt 360 ] ; do
sleep 30
status=$(shepherd get lease ${lease_id} --namespace ${pool_namespace} --json | jq -r .status)
status=$(shepherd get lease ${lease_id} --namespace tas-devex --json | jq -r .status)
if [ $status == "LEASED" ] ; then
shepherd get lease ${lease_id} --namespace ${pool_namespace} --json | jq .output > metadata.json
shepherd get lease ${lease_id} --namespace tas-devex --json | jq .output > metadata.json
break
elif [ $status == "FAILED" -o $status == "EXPIRED" ] ; then
echo "There was an error obtaining the lease. Lease status is ${status}."
Expand All @@ -124,8 +131,16 @@ jobs:
cat metadata.json | jq -r '.name'
echo "lease-id=$lease_id" >> "${GITHUB_OUTPUT}"

- name: Set Up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true

- name: Install Tools
run: |
go version

if [[ ${{ inputs.os }} =~ "windows" ]]
then
install_location=/usr/bin
Expand Down Expand Up @@ -153,7 +168,7 @@ jobs:
credhub --version

apt-get update
apt-get install -y build-essential
apt-get install -y build-essential unzip

- name: Deploy Isolation Segment and OIDC Provider
if: ${{ inputs.capi-version == 'edge' }}
Expand All @@ -168,6 +183,7 @@ jobs:
bosh -d cf manifest > /tmp/manifest.yml
bosh interpolate /tmp/manifest.yml \
-o .github/ops-files/use-cflinuxfs3.yml \
-o cf-deployment/operations/use-internal-lookup-for-route-services.yml \
-o cf-deployment/operations/add-persistent-isolation-segment-diego-cell.yml \
-o cli-ci/ci/infrastructure/operations/add-oidc-provider.yml \
-o cli-ci/ci/infrastructure/operations/add-uaa-client-credentials.yml \
Expand Down Expand Up @@ -201,14 +217,99 @@ jobs:
echo "Deployed CAPI version:"
bosh -d cf releases | grep capi

- name: Set Up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
- name: Add CATS config
if: ${{ inputs.name == 'cats' }}
run: |
set -eu

ENV=$(jq -r .name metadata.json)
API="$(jq -r .cf.api_url metadata.json)"
DOMAIN=$(echo $API | sed "s/^api\.//")
CF_INT_USERNAME="admin"

jq -r .bosh.jumpbox_private_key metadata.json > /tmp/${ENV}.priv
eval "$(bbl print-env --metadata-file ./metadata.json)"

credhub login
CF_INT_PASSWORD=$(credhub get -n /bosh-$ENV/cf/cf_admin_password | bosh interpolate --path /value -)

cat << EOF | jq -S . > cats_config.json
{
"admin_password": "${CF_INT_PASSWORD}",
"admin_user": "${CF_INT_USERNAME}",
"api": "${API}",
"apps_domain": "${DOMAIN}",
"backend" : "diego",
"broker_start_timeout": 330,
"cf_push_timeout": 210,
"default_timeout": 120,
"long_curl_timeout": 210,
"skip_ssl_validation": true,
"use_http": true,
"include_apps": true,
"include_backend_compatibility": false,
"include_container_networking": true,
"include_detect": true,
"include_docker": true,
"include_internet_dependent": true,
"include_isolation_segments": true,
"isolation_segment_name": "persistent_isolation_segment",
"include_private_docker_registry": false,
"include_route_services": true,
"include_routing": true,
"include_routing_isolation_segments": false,
"include_security_groups": true,
"include_services": true,
"include_service_discovery": true,
"include_service_instance_sharing": true,
"include_ssh": true,
"include_sso": false,
"include_tasks": true,
"include_tcp_routing": true,
"include_v3": true,
"include_zipkin": true
}
EOF

make build
echo "$PWD/out" >> $GITHUB_PATH
export PATH="$PWD/out:$PATH"
cf version

export CF_USERNAME=${CF_INT_USERNAME}
export CF_PASSWORD=${CF_INT_PASSWORD}
cf api ${API} --skip-ssl-validation
cf auth
cf enable-feature-flag diego_docker
cf enable-feature-flag service_instance_sharing

- name: Run CATS Tests
if: ${{ inputs.name == 'cats' }}
run: |
set -xeu

export CONFIG
CONFIG=$(mktemp)

original_config="${PWD}/cats_config.json"
cp ${original_config} ${CONFIG}

cd ./cf-acceptance-tests
export CF_DIAL_TIMEOUT=11
export CF_PLUGIN_HOME=$HOME
go version

./bin/test \
--keep-going \
--randomize-all \
--skip-package=helpers \
--nodes="12" \
--flake-attempts=2 \
--timeout="2h" \
--no-color

- name: Run Integration Tests
if: ${{ !inputs.run-with-client-creds }}
if: ${{ !inputs.run-with-client-creds && inputs.name != 'cats' }}
run: |
ENV=$(cat metadata.json | jq -r '.name')
jq -r .bosh.jumpbox_private_key metadata.json > /tmp/${ENV}.priv
Expand Down
29 changes: 28 additions & 1 deletion .github/workflows/tests-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,28 @@ on:
- run-integration-tests-cf-env
- run-integration-tests-cf-env-with-client-creds
- run-integration-tests-cf-env-with-min-capi
- run-cats-cf-env
# - run-integration-windows
# - run-integration-windows-client-credentials
workflow_run:
workflows:
- "Tests"
types:
- completed
branches:
- v8

jobs:
# setup:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout cli
# uses: actions/checkout@v4
# with:
# ref: ${{github.event.workflow_run.head_sha}}

jobs:
run-integration-tests-cf-env:
# needs: setup
name: Integration tests
if: ${{ (github.event_name == 'workflow_dispatch' && inputs.workflow == 'run-integration-tests-cf-env') || github.event.workflow_run.conclusion == 'success' }}
uses: ./.github/workflows/tests-integration-reusable.yml
Expand All @@ -35,6 +47,7 @@ jobs:
secrets: inherit

run-integration-tests-cf-env-with-client-creds:
# needs: setup
name: client creds
if: ${{ (github.event_name == 'workflow_dispatch' && inputs.workflow == 'run-integration-tests-cf-env-with-client-creds') || github.event.workflow_run.conclusion == 'success' }}
uses: ./.github/workflows/tests-integration-reusable.yml
Expand All @@ -47,6 +60,7 @@ jobs:
secrets: inherit

run-integration-tests-cf-env-with-min-capi:
# needs: setup
name: MIN CAPI
if: ${{ (github.event_name == 'workflow_dispatch' && inputs.workflow == 'run-integration-tests-cf-env-with-min-capi') || github.event.workflow_run.conclusion == 'success' }}
uses: ./.github/workflows/tests-integration-reusable.yml
Expand All @@ -56,9 +70,22 @@ jobs:
os: ubuntu-latest
name: Integration MIN CAPI
pool-name: cfd_16_11_0
pool-namespace: tas-devex
is-pr: ${{ github.event_name != 'workflow_dispatch' }}
secrets: inherit

run-cats-cf-env:
name: CATS
if: ${{ (github.event_name == 'workflow_dispatch' && inputs.workflow == 'run-cats-cf-env') || github.event.workflow_run.conclusion == 'success' }}
uses: ./.github/workflows/tests-integration-reusable.yml
with:
capi-version: edge
run-with-client-creds: false
os: ubuntu-latest
name: cats
is-pr: ${{ github.event_name != 'workflow_dispatch' }}
secrets: inherit

#run-integration-windows:
# name: Windows
# if: ${{ (github.event_name == 'workflow_dispatch' && inputs.workflow == 'run-integration-windows') || github.event.workflow_run.conclusion == 'success' }}
Expand Down