Skip to content

Commit 198e4a3

Browse files
Merge pull request #27 from heroku/skip-remote-tests
comment out instead of skip remote ci tests due to changling
2 parents 00c9214 + 6aa039e commit 198e4a3

File tree

1 file changed

+98
-97
lines changed

1 file changed

+98
-97
lines changed

.github/workflows/test.yml

Lines changed: 98 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -41,100 +41,101 @@ jobs:
4141
###########################################################################
4242
# 2 - Deploy this PR to a temp Heroku app and run tests against deployed app (in addition to 'local')
4343
###########################################################################
44-
remote:
45-
if: false # These e2d depployment tests are super useful, but require you to add a HEROKU_API_KEY to your repo's actions secrets.
46-
runs-on: ubuntu-latest
47-
env:
48-
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
49-
API_KEY: ci-test-key
50-
# also note that github CI doesn't have access to your app's config vars, so here we're setting the remote
51-
# server type to streamable HTTP. Folks using SSE would need to change this line for their e2e remote integration
52-
# tests to test SSE instead of streamable HTTP.
53-
REMOTE_SERVER_TRANSPORT_MODULE: streamable_http_server
54-
# $APP_NAME is set below because we need to shorten the repo owner's name, as a precaution
55-
56-
steps:
57-
- uses: actions/checkout@v4
58-
with:
59-
fetch-depth: 0 # <-- disables shallow clone, which heroku is upset by when running git push heroku later on
60-
61-
# Setting a short $APP_NAME that will be unique even if folks choose to fork this repo --> avoids clashes.
62-
# Needs to be shortened if the github repo owner has a long name (max 30 char app name heroku limit).
63-
- name: Generate short APP_NAME
64-
id: appname
65-
run: |
66-
OWNER_SHORT=${GITHUB_REPOSITORY_OWNER:0:5}
67-
REPO_NAME=$(basename "$GITHUB_REPOSITORY")
68-
PR_NUMBER=$(jq .number "$GITHUB_EVENT_PATH")
69-
APP_NAME="${OWNER_SHORT}-${REPO_NAME}-${PR_NUMBER}"
70-
echo "APP_NAME=$APP_NAME"
71-
echo "APP_NAME=$APP_NAME" >> $GITHUB_ENV
72-
73-
- name: Read Python version from .python-version
74-
id: python-version
75-
run: |
76-
PY_VERSION=$(cat .python-version)
77-
echo "version=$PY_VERSION" >> $GITHUB_OUTPUT
78-
79-
- uses: actions/setup-python@v5
80-
with:
81-
python-version: ${{ steps.python-version.outputs.version }}
82-
83-
- name: Install Heroku CLI
84-
run: |
85-
curl https://cli-assets.heroku.com/install.sh | sh
86-
87-
- name: Log in to Heroku
88-
run: |
89-
echo "$HEROKU_API_KEY" | heroku auth:token
90-
91-
- name: Pre-cleanup (destroy app if it exists)
92-
continue-on-error: true
93-
run: |
94-
heroku apps:destroy --app $APP_NAME --confirm $APP_NAME
95-
96-
# github CI can't use our app.json, so the config etc bits must be set manually.
97-
# note WEB_CONCURRENCY is important! You get non-deterministic errors w/out it.
98-
- name: Create temp Heroku app for this PR
99-
run: |
100-
heroku create $APP_NAME
101-
heroku buildpacks:set heroku/python -a $APP_NAME
102-
heroku config:set API_KEY=$API_KEY --app $APP_NAME
103-
heroku config:set STDIO_MODE_ONLY=false
104-
heroku config:set REMOTE_SERVER_TRANSPORT_MODULE=$REMOTE_SERVER_TRANSPORT_MODULE --app $APP_NAME
105-
heroku config:set WEB_CONCURRENCY=1 --app $APP_NAME
106-
107-
- name: Deploy this branch to Heroku
108-
run: |
109-
git push https://heroku:[email protected]/$APP_NAME.git HEAD:refs/heads/main --force
110-
111-
- uses: actions/cache@v4
112-
with:
113-
path: ~/.cache/pip
114-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
115-
116-
- name: Install test dependencies
117-
run: |
118-
python -m pip install --upgrade pip
119-
pip install -r requirements.txt
120-
121-
- name: Get Heroku env vars
122-
id: heroku_env
123-
run: |
124-
url=$(heroku info -s -a $APP_NAME | grep web_url | cut -d= -f2 | tr -d '\n')
125-
echo "url=$url" >> "$GITHUB_OUTPUT"
126-
127-
- name: Run pytest against deployed app
128-
env:
129-
MCP_SERVER_URL: ${{ steps.heroku_env.outputs.url }}
130-
run: |
131-
echo "APP_NAME = $APP_NAME"
132-
echo "MCP_SERVER_URL = $MCP_SERVER_URL"
133-
echo "REMOTE_SERVER_TRANSPORT_MODULE = $REMOTE_SERVER_TRANSPORT_MODULE"
134-
echo "API_KEY is ${API_KEY:+set}" # won't print the key, just confirms it's non-empty
135-
pytest -q
136-
137-
- name: Destroy Heroku app after test
138-
if: always()
139-
run: |
140-
heroku apps:destroy --app $APP_NAME --confirm $APP_NAME
44+
# # These e2d deployment tests are super useful, but require you to add a HEROKU_API_KEY to your repo's actions secrets.
45+
# # --> Uncomment after adding HEROKU_API_KEY to your forked repo's github action secrets.
46+
# remote:
47+
# runs-on: ubuntu-latest
48+
# env:
49+
# HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
50+
# API_KEY: ci-test-key
51+
# # also note that github CI doesn't have access to your app's config vars, so here we're setting the remote
52+
# # server type to streamable HTTP. Folks using SSE would need to change this line for their e2e remote integration
53+
# # tests to test SSE instead of streamable HTTP.
54+
# REMOTE_SERVER_TRANSPORT_MODULE: streamable_http_server
55+
# # $APP_NAME is set below because we need to shorten the repo owner's name, as a precaution
56+
57+
# steps:
58+
# - uses: actions/checkout@v4
59+
# with:
60+
# fetch-depth: 0 # <-- disables shallow clone, which heroku is upset by when running git push heroku later on
61+
62+
# # Setting a short $APP_NAME that will be unique even if folks choose to fork this repo --> avoids clashes.
63+
# # Needs to be shortened if the github repo owner has a long name (max 30 char app name heroku limit).
64+
# - name: Generate short APP_NAME
65+
# id: appname
66+
# run: |
67+
# OWNER_SHORT=${GITHUB_REPOSITORY_OWNER:0:5}
68+
# REPO_NAME=$(basename "$GITHUB_REPOSITORY")
69+
# PR_NUMBER=$(jq .number "$GITHUB_EVENT_PATH")
70+
# APP_NAME="${OWNER_SHORT}-${REPO_NAME}-${PR_NUMBER}"
71+
# echo "APP_NAME=$APP_NAME"
72+
# echo "APP_NAME=$APP_NAME" >> $GITHUB_ENV
73+
74+
# - name: Read Python version from .python-version
75+
# id: python-version
76+
# run: |
77+
# PY_VERSION=$(cat .python-version)
78+
# echo "version=$PY_VERSION" >> $GITHUB_OUTPUT
79+
80+
# - uses: actions/setup-python@v5
81+
# with:
82+
# python-version: ${{ steps.python-version.outputs.version }}
83+
84+
# - name: Install Heroku CLI
85+
# run: |
86+
# curl https://cli-assets.heroku.com/install.sh | sh
87+
88+
# - name: Log in to Heroku
89+
# run: |
90+
# echo "$HEROKU_API_KEY" | heroku auth:token
91+
92+
# - name: Pre-cleanup (destroy app if it exists)
93+
# continue-on-error: true
94+
# run: |
95+
# heroku apps:destroy --app $APP_NAME --confirm $APP_NAME
96+
97+
# # github CI can't use our app.json, so the config etc bits must be set manually.
98+
# # note WEB_CONCURRENCY is important! You get non-deterministic errors w/out it.
99+
# - name: Create temp Heroku app for this PR
100+
# run: |
101+
# heroku create $APP_NAME
102+
# heroku buildpacks:set heroku/python -a $APP_NAME
103+
# heroku config:set API_KEY=$API_KEY --app $APP_NAME
104+
# heroku config:set STDIO_MODE_ONLY=false
105+
# heroku config:set REMOTE_SERVER_TRANSPORT_MODULE=$REMOTE_SERVER_TRANSPORT_MODULE --app $APP_NAME
106+
# heroku config:set WEB_CONCURRENCY=1 --app $APP_NAME
107+
108+
# - name: Deploy this branch to Heroku
109+
# run: |
110+
# git push https://heroku:[email protected]/$APP_NAME.git HEAD:refs/heads/main --force
111+
112+
# - uses: actions/cache@v4
113+
# with:
114+
# path: ~/.cache/pip
115+
# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
116+
117+
# - name: Install test dependencies
118+
# run: |
119+
# python -m pip install --upgrade pip
120+
# pip install -r requirements.txt
121+
122+
# - name: Get Heroku env vars
123+
# id: heroku_env
124+
# run: |
125+
# url=$(heroku info -s -a $APP_NAME | grep web_url | cut -d= -f2 | tr -d '\n')
126+
# echo "url=$url" >> "$GITHUB_OUTPUT"
127+
128+
# - name: Run pytest against deployed app
129+
# env:
130+
# MCP_SERVER_URL: ${{ steps.heroku_env.outputs.url }}
131+
# run: |
132+
# echo "APP_NAME = $APP_NAME"
133+
# echo "MCP_SERVER_URL = $MCP_SERVER_URL"
134+
# echo "REMOTE_SERVER_TRANSPORT_MODULE = $REMOTE_SERVER_TRANSPORT_MODULE"
135+
# echo "API_KEY is ${API_KEY:+set}" # won't print the key, just confirms it's non-empty
136+
# pytest -q
137+
138+
# - name: Destroy Heroku app after test
139+
# if: always()
140+
# run: |
141+
# heroku apps:destroy --app $APP_NAME --confirm $APP_NAME

0 commit comments

Comments
 (0)