Skip to content

Commit 9645621

Browse files
authored
chore: run integ tests during the release workflow (#1897)
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Add integration tests to the release workflow, including new GitHub Actions workflow and CLI tools for managing test execution. > > - **Workflows**: > - Add `.github/workflows/integ-tests.yml` to define integration tests workflow for `ubuntu-22.04` and `macos-14`. > - Modify `release.yml` to include `integ-tests` job, triggering integration tests during the release process. > - **Scripts**: > - Add `tools/bctl` and `tools/bctl_src/bctl.py` to manage integration test execution via CLI. > - Implement `tools/bctl_src/integ_tests.py` to define functions for running integration tests for Python, TypeScript, and Ruby. > - **Misc**: > - Update `uv.lock` in `engine/language_client_python` and `integ-tests/python` for dependency management. > - Modify `clients.baml` in `integ-tests/baml_src` and `inlinedbaml` files in `integ-tests` for Python, Ruby, and TypeScript to adjust client configurations. > - Update `tools/build` to adjust test execution commands. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for a7fe33b. You can [customize](https://app.ellipsis.dev/BoundaryML/settings/summaries) this summary. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
1 parent f198ba3 commit 9645621

16 files changed

Lines changed: 271 additions & 13 deletions

File tree

.github/workflows/integ-tests.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# infisical checks this against OIDC
2+
name: integ-tests
3+
4+
on:
5+
workflow_call: {}
6+
workflow_dispatch: {}
7+
push:
8+
branches: [ sam/integ-tests-ci ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read
16+
# for oidc
17+
id-token: write
18+
19+
jobs:
20+
build-test:
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
_:
25+
- runs-on: ubuntu-22.04
26+
setup: |
27+
env | sort
28+
curl -fsSL https://ollama.com/install.sh | sh
29+
# test: |
30+
# ollama serve &
31+
# sleep 5
32+
# ollama run tinyllama "2+2?"
33+
# ./tools/build integ-tests/python
34+
# ./tools/build integ-tests/typescript
35+
# ./tools/build integ-tests/ruby
36+
37+
- runs-on: macos-14
38+
setup: |
39+
env | sort
40+
brew install ollama go
41+
# test: |
42+
# ollama serve &
43+
# sleep 5
44+
# ollama run tinyllama "2+2?"
45+
# ./tools/build integ-tests/python
46+
# ./tools/build integ-tests/typescript
47+
# ./tools/build integ-tests/ruby
48+
49+
# winget is not available on windows-2019 or windows-2022
50+
# https://github.com/actions/runner-images/issues/8584
51+
# winget upgrade --all --silent --disable-interactivity --accept-source-agreements --accept-package-agreements
52+
# - runs-on: windows-2025
53+
# setup: |
54+
# env | sort
55+
# winget install --id=Ollama.Ollama -e --accept-package-agreements --accept-source-agreements
56+
57+
name: ${{ matrix._.runs-on }}
58+
runs-on: ${{ matrix._.runs-on }}
59+
# For when we have go integ tests
60+
# env:
61+
# GOARCH: ${{ matrix._.goarch }}
62+
steps:
63+
- uses: actions/checkout@v4
64+
- uses: actions/cache@v4
65+
with:
66+
path: |
67+
~/.ollama/models
68+
key: ollama-${{ matrix._.runs-on }}
69+
- uses: Swatinem/rust-cache@v2
70+
with:
71+
workspaces: engine
72+
cache-on-failure: true
73+
- uses: jdx/mise-action@v2
74+
env:
75+
GITHUB_TOKEN: ${{ github.token }}
76+
- uses: astral-sh/setup-uv@v6
77+
- name: Setup
78+
run: ${{ matrix._.setup }}
79+
- uses: infisical/secrets-action@v1.0.9
80+
with:
81+
method: oidc
82+
# https://app.infisical.com/organization/identities/5b66a909-d5b3-4835-b518-27abf4c9b97d
83+
identity-id: 5b66a909-d5b3-4835-b518-27abf4c9b97d
84+
env-slug: test
85+
project-slug: gloo-infra-9-fkp
86+
87+
- name: setup TS
88+
run: pnpm install --frozen-lockfile
89+
working-directory: engine/language_client_typescript
90+
91+
- name: Run all integ tests
92+
run: |
93+
ollama serve &
94+
sleep 5
95+
ollama run tinyllama "2+2?"
96+
# If this fails, still run the next one
97+
./tools/bctl integ-tests --suite python
98+
# If this fails, still run the next one
99+
./tools/bctl integ-tests --suite typescript
100+
# If this fails, still run the next one
101+
./tools/bctl integ-tests --suite ruby

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
echo "is_release_tag=$IS_RELEASE" >> $GITHUB_OUTPUT
5959
echo "Determined version: $VERSION"
6060
echo "Is release tag: $IS_RELEASE"
61+
6162
build-python-release:
6263
uses: ./.github/workflows/build-python-release.reusable.yaml
6364

@@ -83,6 +84,11 @@ jobs:
8384
version: ${{ needs.determine-version.outputs.version_string }}
8485
# Pass the boolean output directly
8586
is_release_build: ${{ needs.determine-version.outputs.is_release_tag == 'true' }}
87+
88+
# Kick off integration tests when we build everything.
89+
# This does not yet succeed/pass consistently, or even run everything, but it's a good start.
90+
integ-tests:
91+
uses: ./.github/workflows/integ-tests.yml
8692

8793
# placeholder fan-in step
8894
all-builds:

engine/language_client_python/uv.lock

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integ-tests/baml_src/clients.baml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ client<llm> VertexClaude {
176176
model "claude-3-5-sonnet@20240620"
177177
location us-east5
178178
anthropic_version "vertex-2023-10-16"
179-
// credentials env.INTEG_TESTS_GOOGLE_APPLICATION_CREDENTIALS_CONTENT
179+
credentials env.INTEG_TESTS_GOOGLE_APPLICATION_CREDENTIALS_CONTENT
180180
}
181181
}
182182

integ-tests/go/baml_client/inlinedbaml.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integ-tests/python/baml_client/inlinedbaml.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integ-tests/python/uv.lock

Lines changed: 17 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integ-tests/react/baml_client/inlinedbaml.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integ-tests/ruby/baml_client/inlined.rb

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integ-tests/typescript-esm/baml_client/inlinedbaml.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)