-
Notifications
You must be signed in to change notification settings - Fork 891
Add E2E scenario tests/examples for all SDK languages #512
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
Changes from all commits
6a01e9f
5f008ad
f006da3
674719c
1db7315
e3856b1
3275b12
db37c0f
6cee34a
e61e9a6
a00d0d7
49f199a
997a73b
0f6ecd3
e88df1b
08adc4e
39f0ec4
d3cd6a3
ccda964
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,186 @@ | ||
| name: "Scenario Build Verification" | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "test/scenarios/**" | ||
| - "nodejs/src/**" | ||
| - "python/copilot/**" | ||
| - "go/**/*.go" | ||
| - "dotnet/src/**" | ||
| - ".github/workflows/scenario-builds.yml" | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - "test/scenarios/**" | ||
| - ".github/workflows/scenario-builds.yml" | ||
| workflow_dispatch: | ||
| merge_group: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| # ── TypeScript ────────────────────────────────────────────────────── | ||
| build-typescript: | ||
| name: "TypeScript scenarios" | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 22 | ||
|
|
||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.npm | ||
| key: ${{ runner.os }}-npm-scenarios-${{ hashFiles('test/scenarios/**/package.json') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-npm-scenarios- | ||
| # Build the SDK so local file: references resolve | ||
| - name: Build SDK | ||
| working-directory: nodejs | ||
| run: npm ci --ignore-scripts | ||
|
|
||
| - name: Build all TypeScript scenarios | ||
| run: | | ||
| PASS=0; FAIL=0; FAILURES="" | ||
| for dir in $(find test/scenarios -path '*/typescript/package.json' -exec dirname {} \; | sort); do | ||
| scenario="${dir#test/scenarios/}" | ||
| echo "::group::$scenario" | ||
| if (cd "$dir" && npm install --ignore-scripts 2>&1); then | ||
| echo "✅ $scenario" | ||
| PASS=$((PASS + 1)) | ||
| else | ||
| echo "❌ $scenario" | ||
| FAIL=$((FAIL + 1)) | ||
| FAILURES="$FAILURES\n $scenario" | ||
| fi | ||
| echo "::endgroup::" | ||
| done | ||
| echo "" | ||
| echo "TypeScript builds: $PASS passed, $FAIL failed" | ||
| if [ "$FAIL" -gt 0 ]; then | ||
| echo -e "Failures:$FAILURES" | ||
| exit 1 | ||
| fi | ||
| # ── Python ────────────────────────────────────────────────────────── | ||
| build-python: | ||
| name: "Python scenarios" | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install Python SDK | ||
| run: pip install -e python/ | ||
|
|
||
| - name: Compile and import-check all Python scenarios | ||
| run: | | ||
| PASS=0; FAIL=0; FAILURES="" | ||
| for main in $(find test/scenarios -path '*/python/main.py' | sort); do | ||
| dir=$(dirname "$main") | ||
| scenario="${dir#test/scenarios/}" | ||
| echo "::group::$scenario" | ||
| if python3 -m py_compile "$main" 2>&1 && python3 -c "import copilot" 2>&1; then | ||
| echo "✅ $scenario" | ||
| PASS=$((PASS + 1)) | ||
| else | ||
| echo "❌ $scenario" | ||
| FAIL=$((FAIL + 1)) | ||
| FAILURES="$FAILURES\n $scenario" | ||
| fi | ||
| echo "::endgroup::" | ||
| done | ||
| echo "" | ||
| echo "Python builds: $PASS passed, $FAIL failed" | ||
| if [ "$FAIL" -gt 0 ]; then | ||
| echo -e "Failures:$FAILURES" | ||
| exit 1 | ||
| fi | ||
| # ── Go ────────────────────────────────────────────────────────────── | ||
| build-go: | ||
| name: "Go scenarios" | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: "1.24" | ||
| cache: true | ||
| cache-dependency-path: test/scenarios/**/go.sum | ||
|
|
||
| - name: Build all Go scenarios | ||
| run: | | ||
| PASS=0; FAIL=0; FAILURES="" | ||
| for mod in $(find test/scenarios -path '*/go/go.mod' | sort); do | ||
| dir=$(dirname "$mod") | ||
| scenario="${dir#test/scenarios/}" | ||
| echo "::group::$scenario" | ||
| if (cd "$dir" && go build ./... 2>&1); then | ||
| echo "✅ $scenario" | ||
| PASS=$((PASS + 1)) | ||
| else | ||
| echo "❌ $scenario" | ||
| FAIL=$((FAIL + 1)) | ||
| FAILURES="$FAILURES\n $scenario" | ||
| fi | ||
| echo "::endgroup::" | ||
| done | ||
| echo "" | ||
| echo "Go builds: $PASS passed, $FAIL failed" | ||
| if [ "$FAIL" -gt 0 ]; then | ||
| echo -e "Failures:$FAILURES" | ||
| exit 1 | ||
| fi | ||
| # ── C# ───────────────────────────────────────────────────────────── | ||
| build-csharp: | ||
| name: "C# scenarios" | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-dotnet@v5 | ||
| with: | ||
| dotnet-version: "8.0.x" | ||
|
|
||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.nuget/packages | ||
| key: ${{ runner.os }}-nuget-scenarios-${{ hashFiles('test/scenarios/**/*.csproj') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-nuget-scenarios- | ||
| - name: Build all C# scenarios | ||
| run: | | ||
| PASS=0; FAIL=0; FAILURES="" | ||
| for proj in $(find test/scenarios -name '*.csproj' | sort); do | ||
| dir=$(dirname "$proj") | ||
| scenario="${dir#test/scenarios/}" | ||
| echo "::group::$scenario" | ||
| if (cd "$dir" && dotnet build --nologo 2>&1); then | ||
| echo "✅ $scenario" | ||
| PASS=$((PASS + 1)) | ||
| else | ||
| echo "❌ $scenario" | ||
| FAIL=$((FAIL + 1)) | ||
| FAILURES="$FAILURES\n $scenario" | ||
| fi | ||
| echo "::endgroup::" | ||
| done | ||
| echo "" | ||
| echo "C# builds: $PASS passed, $FAIL failed" | ||
| if [ "$FAIL" -gt 0 ]; then | ||
| echo -e "Failures:$FAILURES" | ||
| exit 1 | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
|
|
||
| # Documentation validation output | ||
| docs/.validation/ | ||
| .DS_Store |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -105,9 +105,15 @@ public CopilotClient(CopilotClientOptions? options = null) | |
| _options = options ?? new(); | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cross-SDK consistency issue: The validation logic change here is not reflected in the other SDKs. The .NET SDK now only validates that However, the other three SDKs still have the stricter validation:
Recommendation: Either:
The current state creates an inconsistency where .NET users can set both
|
||
| // Validate mutually exclusive options | ||
| if (!string.IsNullOrEmpty(_options.CliUrl) && (_options.UseStdio || _options.CliPath != null)) | ||
| if (!string.IsNullOrEmpty(_options.CliUrl) && _options.CliPath != null) | ||
| { | ||
| throw new ArgumentException("CliUrl is mutually exclusive with UseStdio and CliPath"); | ||
| throw new ArgumentException("CliUrl is mutually exclusive with CliPath"); | ||
| } | ||
|
|
||
| // When CliUrl is provided, disable UseStdio (we connect to an external server, not spawn one) | ||
| if (!string.IsNullOrEmpty(_options.CliUrl)) | ||
| { | ||
| _options.UseStdio = false; | ||
| } | ||
|
|
||
| // Validate auth options with external server | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a bit odd - is it really doing a build? Looks like it just does
npm install