Skip to content

Commit

Permalink
tooling: split end-to-end tests by SDK for easier analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
manicminer committed Aug 18, 2024
1 parent 789b1b3 commit 4e5e8db
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 9 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/unit-test-end-to-end-microsoft-graph.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Verify All Microsoft Graph Services can be Imported and Generated
on:
pull_request:
types: ['opened', 'synchronize']
paths:
- '.github/workflows/**'
- 'config/**'

jobs:
test:
runs-on: custom-linux-xl
strategy:
fail-fast: true
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: recursive

- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: ./.go-version

- name: "Build and Run importer-msgraph-metadata"
id: import-data
run: |
cd ./tools/importer-msgraph-metadata
make tools
make build
make import
- name: "Run the Go SDK Generator"
run: |
# go go gadget generator
./scripts/automation-generate-go-sdk.sh microsoft-graph
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
- name: "Run the Go SDK Generator"
run: |
# go go gadget generator
./scripts/automation-generate-go-sdk.sh
./scripts/automation-generate-go-sdk.sh resource-manager
23 changes: 15 additions & 8 deletions scripts/automation-generate-go-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ set -e

DIR="$(cd "$(dirname "$0")" && pwd)/.."

sdkToGenerate="${1}"
if [[ "${sdkToGenerate}" == "" ]]; then
echo "must specify SDK to generate!" >&2
echo "" >&2
echo "supported values are:" >&2
echo " microsoft-graph" >&2
echo " resource-manager" >&2
echo "" >&2
echo "example usage:" >&2
echo "${0} resource-manager" >&2
exit 1
fi

function buildAndInstallDependencies {
echo "Outputting Go Version.."
go version
Expand All @@ -31,15 +44,9 @@ function runWrapper {
local apiDefinitionsDirectory=$1
local outputDirectory=$2

echo "Running Wrapper for Resource Manager.."
cd "${DIR}/tools/wrapper-automation"
./wrapper-automation resource-manager go-sdk \
--api-definitions-dir="../../$apiDefinitionsDirectory"\
--output-dir="../../$outputDirectory"

echo "Running Wrapper for Microsoft Graph.."
echo "Running Wrapper for ${sdkToGenerate}.."
cd "${DIR}/tools/wrapper-automation"
./wrapper-automation microsoft-graph go-sdk \
./wrapper-automation "${sdkToGenerate}" go-sdk \
--api-definitions-dir="../../$apiDefinitionsDirectory"\
--output-dir="../../$outputDirectory"

Expand Down

0 comments on commit 4e5e8db

Please sign in to comment.