Skip to content
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

feat: Added microtenant support to new application segment endpoints #256

Merged
merged 5 commits into from
Jun 7, 2024
Merged
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
357 changes: 179 additions & 178 deletions .github/workflows/zpa-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,206 +12,206 @@ on:
workflow_dispatch:

jobs:
zpa-qa1-tenants:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
goVersion: ["1.21"]
environment:
- ZPA_QA_TENANT01
- ZPA_QA_TENANT02
environment: ${{ matrix.environment }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
# zpa-qa1-tenants:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# goVersion: ["1.21"]
# environment:
# - ZPA_QA_TENANT01
# - ZPA_QA_TENANT02
# environment: ${{ matrix.environment }}
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.goVersion }}
# - name: Setup Go
# uses: actions/setup-go@v5
# with:
# go-version: ${{ matrix.goVersion }}

- name: Clean existing Go modules
run: go clean -modcache
# - name: Clean existing Go modules
# run: go clean -modcache

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# - name: Cache Go modules
# uses: actions/cache@v4
# with:
# path: |
# ~/go/pkg/mod
# ~/.cache/go-build
# key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
# restore-keys: |
# ${{ runner.os }}-go-

- name: Set Go env
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
# - name: Set Go env
# run: |
# echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
# echo "$(go env GOPATH)/bin" >> $GITHUB_PATH

- name: Install dependencies
run: go mod download
# - name: Install dependencies
# run: go mod download

- name: Run tests with retry
uses: nick-fields/retry@v2
with:
max_attempts: 3
timeout_minutes: 20
command: |
make test:unit:zpa
make sweep:zpa
make test:integration:zpa
make sweep:zpa
env:
ZPA_CLIENT_ID: ${{ secrets.ZPA_CLIENT_ID }}
ZPA_CLIENT_SECRET: ${{ secrets.ZPA_CLIENT_SECRET }}
ZPA_CUSTOMER_ID: ${{ secrets.ZPA_CUSTOMER_ID }}
ZPA_CLOUD: ${{ secrets.ZPA_CLOUD }}
ZPA_SDK_TEST_SWEEP: ${{ secrets.ZPA_SDK_TEST_SWEEP }}
ZSCALER_SDK_CACHE_DISABLED: ${{ secrets.ZSCALER_SDK_CACHE_DISABLED }}
OKTA_CLIENT_ORGURL: ${{ secrets.OKTA_CLIENT_ORGURL }}
OKTA_CLIENT_TOKEN: ${{ secrets.OKTA_CLIENT_TOKEN }}
# - name: Run tests with retry
# uses: nick-fields/retry@v2
# with:
# max_attempts: 3
# timeout_minutes: 20
# command: |
# make test:unit:zpa
# make sweep:zpa
# make test:integration:zpa
# make sweep:zpa
# env:
# ZPA_CLIENT_ID: ${{ secrets.ZPA_CLIENT_ID }}
# ZPA_CLIENT_SECRET: ${{ secrets.ZPA_CLIENT_SECRET }}
# ZPA_CUSTOMER_ID: ${{ secrets.ZPA_CUSTOMER_ID }}
# ZPA_CLOUD: ${{ secrets.ZPA_CLOUD }}
# ZPA_SDK_TEST_SWEEP: ${{ secrets.ZPA_SDK_TEST_SWEEP }}
# ZSCALER_SDK_CACHE_DISABLED: ${{ secrets.ZSCALER_SDK_CACHE_DISABLED }}
# OKTA_CLIENT_ORGURL: ${{ secrets.OKTA_CLIENT_ORGURL }}
# OKTA_CLIENT_TOKEN: ${{ secrets.OKTA_CLIENT_TOKEN }}

- name: Publish test coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.out
fail_ci_if_error: true
# - name: Publish test coverage
# uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# file: ./coverage.out
# fail_ci_if_error: true

zpa-qa2-tenants:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
goVersion: ["1.21"]
environment:
- ZPA_QA2_TENANT01
# - ZPA_QA2_TENANT02
environment: ${{ matrix.environment }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Clean existing Go modules
run: go clean -modcache
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.goVersion }}
# zpa-qa2-tenants:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# goVersion: ["1.21"]
# environment:
# - ZPA_QA2_TENANT01
# # - ZPA_QA2_TENANT02
# environment: ${{ matrix.environment }}
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# - name: Clean existing Go modules
# run: go clean -modcache
# - name: Setup Go
# uses: actions/setup-go@v5
# with:
# go-version: ${{ matrix.goVersion }}

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# - name: Cache Go modules
# uses: actions/cache@v4
# with:
# path: |
# ~/go/pkg/mod
# ~/.cache/go-build
# key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
# restore-keys: |
# ${{ runner.os }}-go-

- name: Set Go env
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
# - name: Set Go env
# run: |
# echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
# echo "$(go env GOPATH)/bin" >> $GITHUB_PATH

- name: Install dependencies
run: go mod download
# - name: Install dependencies
# run: go mod download

- name: Run tests with retry
uses: nick-fields/retry@v2
with:
max_attempts: 3
timeout_minutes: 20
command: |
make test:unit:zpa
make sweep:zpa
make test:integration:zpa
make sweep:zpa
env:
ZPA_CLIENT_ID: ${{ secrets.ZPA_CLIENT_ID }}
ZPA_CLIENT_SECRET: ${{ secrets.ZPA_CLIENT_SECRET }}
ZPA_CUSTOMER_ID: ${{ secrets.ZPA_CUSTOMER_ID }}
ZPA_CLOUD: ${{ secrets.ZPA_CLOUD }}
ZPA_SDK_TEST_SWEEP: ${{ secrets.ZPA_SDK_TEST_SWEEP }}
ZSCALER_SDK_CACHE_DISABLED: ${{ secrets.ZSCALER_SDK_CACHE_DISABLED }}
OKTA_CLIENT_ORGURL: ${{ secrets.OKTA_CLIENT_ORGURL }}
OKTA_CLIENT_TOKEN: ${{ secrets.OKTA_CLIENT_TOKEN }}
# - name: Run tests with retry
# uses: nick-fields/retry@v2
# with:
# max_attempts: 3
# timeout_minutes: 20
# command: |
# make test:unit:zpa
# make sweep:zpa
# make test:integration:zpa
# make sweep:zpa
# env:
# ZPA_CLIENT_ID: ${{ secrets.ZPA_CLIENT_ID }}
# ZPA_CLIENT_SECRET: ${{ secrets.ZPA_CLIENT_SECRET }}
# ZPA_CUSTOMER_ID: ${{ secrets.ZPA_CUSTOMER_ID }}
# ZPA_CLOUD: ${{ secrets.ZPA_CLOUD }}
# ZPA_SDK_TEST_SWEEP: ${{ secrets.ZPA_SDK_TEST_SWEEP }}
# ZSCALER_SDK_CACHE_DISABLED: ${{ secrets.ZSCALER_SDK_CACHE_DISABLED }}
# OKTA_CLIENT_ORGURL: ${{ secrets.OKTA_CLIENT_ORGURL }}
# OKTA_CLIENT_TOKEN: ${{ secrets.OKTA_CLIENT_TOKEN }}

zpa-beta-tenants:
needs: [zpa-qa1-tenants, zpa-qa2-tenants]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
goVersion: ["1.21"]
environment:
- ZPA_BETA_TENANT01
environment: ${{ matrix.environment }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
# zpa-beta-tenants:
# needs: [zpa-qa1-tenants, zpa-qa2-tenants]
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# goVersion: ["1.21"]
# environment:
# - ZPA_BETA_TENANT01
# environment: ${{ matrix.environment }}
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.goVersion }}
# - name: Setup Go
# uses: actions/setup-go@v5
# with:
# go-version: ${{ matrix.goVersion }}

- name: Clean existing Go modules
run: go clean -modcache
# - name: Clean existing Go modules
# run: go clean -modcache

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# - name: Cache Go modules
# uses: actions/cache@v4
# with:
# path: |
# ~/go/pkg/mod
# ~/.cache/go-build
# key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
# restore-keys: |
# ${{ runner.os }}-go-

- name: Set Go env
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
# - name: Set Go env
# run: |
# echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
# echo "$(go env GOPATH)/bin" >> $GITHUB_PATH

- name: Install dependencies
run: go mod download
# - name: Install dependencies
# run: go mod download

- name: Run tests with retry
uses: nick-fields/retry@v2
with:
max_attempts: 3
timeout_minutes: 20
command: |
make test:unit:zpa
make sweep:zpa
make test:integration:zpa
make sweep:zpa
env:
ZPA_CLIENT_ID: ${{ secrets.ZPA_CLIENT_ID }}
ZPA_CLIENT_SECRET: ${{ secrets.ZPA_CLIENT_SECRET }}
ZPA_CUSTOMER_ID: ${{ secrets.ZPA_CUSTOMER_ID }}
ZPA_CLOUD: ${{ secrets.ZPA_CLOUD }}
ZPA_SDK_TEST_SWEEP: ${{ secrets.ZPA_SDK_TEST_SWEEP }}
ZSCALER_SDK_CACHE_DISABLED: ${{ secrets.ZSCALER_SDK_CACHE_DISABLED }}
OKTA_CLIENT_ORGURL: ${{ secrets.OKTA_CLIENT_ORGURL }}
OKTA_CLIENT_TOKEN: ${{ secrets.OKTA_CLIENT_TOKEN }}
# - name: Run tests with retry
# uses: nick-fields/retry@v2
# with:
# max_attempts: 3
# timeout_minutes: 20
# command: |
# make test:unit:zpa
# make sweep:zpa
# make test:integration:zpa
# make sweep:zpa
# env:
# ZPA_CLIENT_ID: ${{ secrets.ZPA_CLIENT_ID }}
# ZPA_CLIENT_SECRET: ${{ secrets.ZPA_CLIENT_SECRET }}
# ZPA_CUSTOMER_ID: ${{ secrets.ZPA_CUSTOMER_ID }}
# ZPA_CLOUD: ${{ secrets.ZPA_CLOUD }}
# ZPA_SDK_TEST_SWEEP: ${{ secrets.ZPA_SDK_TEST_SWEEP }}
# ZSCALER_SDK_CACHE_DISABLED: ${{ secrets.ZSCALER_SDK_CACHE_DISABLED }}
# OKTA_CLIENT_ORGURL: ${{ secrets.OKTA_CLIENT_ORGURL }}
# OKTA_CLIENT_TOKEN: ${{ secrets.OKTA_CLIENT_TOKEN }}

- name: Publish test coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.out
fail_ci_if_error: true
# - name: Publish test coverage
# uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# file: ./coverage.out
# fail_ci_if_error: true

zpa-prod-tenants:
needs: [zpa-beta-tenants]
# needs: [zpa-beta-tenants]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -271,6 +271,7 @@ jobs:
ZSCALER_SDK_CACHE_DISABLED: ${{ secrets.ZSCALER_SDK_CACHE_DISABLED }}
OKTA_CLIENT_ORGURL: ${{ secrets.OKTA_CLIENT_ORGURL }}
OKTA_CLIENT_TOKEN: ${{ secrets.OKTA_CLIENT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish test coverage
uses: codecov/codecov-action@v4
Expand Down
Loading
Loading