Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
| run: | | ||
| echo "Running E2E tests with OIDC token..." | ||
| echo "OIDC Token available: $([ -n "$VERCEL_OIDC_TOKEN" ] && echo "Yes" || echo "No")" | ||
| uv run python run_e2e_tests.py --test-type e2e || echo "E2E tests skipped (secrets not available)" |
There was a problem hiding this comment.
The E2E test step will silently succeed even if actual tests fail due to the || (OR) operator. Failed tests will be masked as "skipped" in the CI output, making the build appear green when it should fail.
View Details
📝 Patch Details
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2431eed..0bc987f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -83,7 +83,7 @@ jobs:
run: |
echo "Running E2E tests with OIDC token..."
echo "OIDC Token available: $([ -n "$VERCEL_OIDC_TOKEN" ] && echo "Yes" || echo "No")"
- uv run python run_e2e_tests.py --test-type e2e || echo "E2E tests skipped (secrets not available)"
+ uv run python run_e2e_tests.py --test-type e2e
- name: Cleanup sensitive files
if: always()
diff --git a/run_e2e_tests.py b/run_e2e_tests.py
index 7b5b7ef..1bdf64a 100755
--- a/run_e2e_tests.py
+++ b/run_e2e_tests.py
@@ -205,6 +205,12 @@ class E2ETestRunner:
if test_type == "unit":
return self.run_unit_tests()
elif test_type == "e2e":
+ # Check environment before running E2E tests
+ # If no secrets are available, skip gracefully (exit 0)
+ # If tests actually fail, exit 1
+ if not self.check_environment():
+ print("⏭️ E2E tests skipped (secrets not available)")
+ return True
return self.run_e2e_tests(test_pattern)
elif test_type == "integration":
return self.run_integration_tests()
Analysis
E2E test failures masked as skipped due to shell OR operator
What fails: The CI workflow at line 86 uses || echo "E2E tests skipped..." which masks test failures as successes. When E2E tests fail with exit code 1, the shell OR operator (||) executes the echo command, making the final exit code 0 (success) instead of 1 (failure).
How to reproduce:
# This demonstrates the issue:
uv run python run_e2e_tests.py --test-type e2e || echo "E2E tests skipped"
# If the Python script exits with 1 (test failure), the echo runs and final exit is 0
# If the Python script exits with 0 (success), the echo doesn't run and final exit is 0
# Result: All exit codes become 0, masking failuresResult: Failed E2E tests are reported as "E2E tests skipped (secrets not available)" in CI output, causing the build to pass when tests actually failed.
Expected:
- When secrets unavailable: exit 0 (tests skipped, build continues)
- When tests fail: exit 1 (build fails)
- When tests pass: exit 0 (build continues)
Fix: Moved environment checking into run_specific_tests() so the Python script handles the distinction between "no secrets available" (exit 0) and "tests failed" (exit 1), eliminating the need for the shell OR operator. This ensures that actual test failures are properly reported to CI.
|
|
||
| try: | ||
| updated_project = await update_project( | ||
| project_id=created_project["id"], |
There was a problem hiding this comment.
| project_id=created_project["id"], | |
| id_or_name=created_project["id"], |
The update_project() function is called with incorrect parameter name project_id= instead of the actual parameter name id_or_name=, which will cause a TypeError when the integration test runs.
View Details
Analysis
Incorrect parameter name in update_project() call causes TypeError
What fails: test_projects_blob_integration() in tests/integration/test_integration_e2e.py calls update_project() with parameter name project_id= instead of id_or_name=, causing TypeError: update_project() got an unexpected keyword argument 'project_id'
How to reproduce:
# In tests/integration/test_integration_e2e.py, line 249:
await update_project(
project_id=created_project["id"], # ❌ Wrong parameter name
body=project_update,
token=vercel_token,
team_id=vercel_team_id,
)Result: Runtime TypeError when executing the integration test
Expected: Function should be called with id_or_name= parameter as defined in the function signature at src/vercel/projects/projects.py:142
async def update_project(
id_or_name: str, # ← Actual parameter name
*,
body: dict[str, Any],
...| for project_id in created_projects: | ||
| try: | ||
| await delete_project( | ||
| project_id=project_id, token=vercel_token, team_id=vercel_team_id |
There was a problem hiding this comment.
The delete_project() function is called with incorrect parameter name project_id= instead of the actual parameter name id_or_name=, which will cause a TypeError when the cleanup test runs.
View Details
📝 Patch Details
diff --git a/tests/e2e/test_projects_e2e.py b/tests/e2e/test_projects_e2e.py
index 2fa96fc..8a4022a 100644
--- a/tests/e2e/test_projects_e2e.py
+++ b/tests/e2e/test_projects_e2e.py
@@ -315,7 +315,7 @@ class TestProjectsAPIE2E:
try:
updated_project = await update_project(
- project_id=created_project["id"],
+ id_or_name=created_project["id"],
body=update_data,
token=vercel_token,
team_id=vercel_team_id,
@@ -337,7 +337,7 @@ class TestProjectsAPIE2E:
for project_id in created_projects:
try:
await delete_project(
- project_id=project_id, token=vercel_token, team_id=vercel_team_id
+ id_or_name=project_id, token=vercel_token, team_id=vercel_team_id
)
except Exception:
# Project might already be deleted or not exist
Analysis
Incorrect parameter name in delete_project() and update_project() calls
What fails: test_project_cleanup() and test_project_environment_variables() in tests/e2e/test_projects_e2e.py call delete_project() and update_project() with incorrect parameter name project_id= instead of the actual parameter name id_or_name=, causing TypeError: got an unexpected keyword argument 'project_id'
How to reproduce:
# The bug exists at:
# Line 318: update_project(project_id=...) - wrong parameter name
# Line 340: delete_project(project_id=...) - wrong parameter name
# These calls would fail because delete_project() and update_project() are defined in
# src/vercel/projects/projects.py with signature:
# async def delete_project(id_or_name: str, *, ...)
# async def update_project(id_or_name: str, *, ...)Result: TypeError when tests run - the functions don't have a project_id parameter
Expected: Functions should be called with id_or_name= parameter, as used correctly in other test cases (lines 132, 155, 184, 193 use id_or_name= correctly)
Fix applied: Changed both calls to use correct parameter name id_or_name=
- Line 318:
project_id=→id_or_name= - Line 340:
project_id=→id_or_name=
|
|
||
| try: | ||
| updated_project = await update_project( | ||
| project_id=created_project["id"], |
There was a problem hiding this comment.
The update_project() function is called with incorrect parameter name project_id= instead of the actual parameter name id_or_name=, which will cause a TypeError at runtime.
View Details
📝 Patch Details
diff --git a/tests/e2e/test_projects_e2e.py b/tests/e2e/test_projects_e2e.py
index 2fa96fc..8a4022a 100644
--- a/tests/e2e/test_projects_e2e.py
+++ b/tests/e2e/test_projects_e2e.py
@@ -315,7 +315,7 @@ class TestProjectsAPIE2E:
try:
updated_project = await update_project(
- project_id=created_project["id"],
+ id_or_name=created_project["id"],
body=update_data,
token=vercel_token,
team_id=vercel_team_id,
@@ -337,7 +337,7 @@ class TestProjectsAPIE2E:
for project_id in created_projects:
try:
await delete_project(
- project_id=project_id, token=vercel_token, team_id=vercel_team_id
+ id_or_name=project_id, token=vercel_token, team_id=vercel_team_id
)
except Exception:
# Project might already be deleted or not exist
Analysis
Incorrect parameter names in update_project() and delete_project() calls
What fails: The functions update_project() and delete_project() from vercel.projects are called with incorrect parameter name project_id= instead of the correct parameter name id_or_name=, causing TypeError: update_project() got an unexpected keyword argument 'project_id' (lines 318 and 340).
How to reproduce:
- Run the e2e test suite:
pytest tests/e2e/test_projects_e2e.py::TestProjectsAPIE2E::test_project_environment_variables -v - Or:
pytest tests/e2e/test_projects_e2e.py::TestProjectsAPIE2E::test_project_cleanup -v
Result: Tests fail with TypeError - "update_project() got an unexpected keyword argument 'project_id'" and "delete_project() got an unexpected keyword argument 'project_id'"
Expected: Both functions accept id_or_name as the first positional-or-keyword parameter (defined in src/vercel/projects/projects.py). The function signatures are:
async def update_project(id_or_name: str, *, body: dict[str, Any], ...)
async def delete_project(id_or_name: str, *, token: str | None = None, ...)Fixed: Changed parameter names from project_id= to id_or_name= in both test functions (lines 318 and 340 in tests/e2e/test_projects_e2e.py)
| for project_id in created_projects: | ||
| try: | ||
| await delete_project( | ||
| project_id=project_id, token=vercel_token, team_id=vercel_team_id |
There was a problem hiding this comment.
The delete_project() function is called with incorrect parameter name project_id= instead of the actual parameter name id_or_name=, which will cause a TypeError during integration test cleanup.
View Details
📝 Patch Details
diff --git a/tests/e2e/conftest.py b/tests/e2e/conftest.py
index 7f6b738..b539b88 100644
--- a/tests/e2e/conftest.py
+++ b/tests/e2e/conftest.py
@@ -68,7 +68,7 @@ class E2ETestBase:
for project_id in self.created_projects:
try:
await delete_project(
- project_id=project_id, token=vercel_token, team_id=team_id
+ id_or_name=project_id, token=vercel_token, team_id=team_id
)
except Exception:
# Project might already be deleted
diff --git a/tests/e2e/test_projects_e2e.py b/tests/e2e/test_projects_e2e.py
index 2fa96fc..3b14d9a 100644
--- a/tests/e2e/test_projects_e2e.py
+++ b/tests/e2e/test_projects_e2e.py
@@ -337,7 +337,7 @@ class TestProjectsAPIE2E:
for project_id in created_projects:
try:
await delete_project(
- project_id=project_id, token=vercel_token, team_id=vercel_team_id
+ id_or_name=project_id, token=vercel_token, team_id=vercel_team_id
)
except Exception:
# Project might already be deleted or not exist
diff --git a/tests/integration/test_integration_e2e.py b/tests/integration/test_integration_e2e.py
index dc95649..cb71603 100644
--- a/tests/integration/test_integration_e2e.py
+++ b/tests/integration/test_integration_e2e.py
@@ -532,7 +532,7 @@ class TestVercelSDKIntegration:
for project_id in created_projects:
try:
await delete_project(
- project_id=project_id, token=vercel_token, team_id=vercel_team_id
+ id_or_name=project_id, token=vercel_token, team_id=vercel_team_id
)
except Exception:
# Project might already be deleted
Analysis
Incorrect parameter name in delete_project() calls causes TypeError
What fails: Three test files call delete_project() with incorrect parameter name project_id= instead of the actual parameter id_or_name=, causing TypeError during test cleanup operations.
How to reproduce:
# The delete_project function signature (src/vercel/projects/projects.py:179):
async def delete_project(
id_or_name: str,
*,
token: str | None = None,
team_id: str | None = None,
...
) -> None
# These calls fail:
# 1. tests/integration/test_integration_e2e.py:535
await delete_project(project_id=project_id, token=vercel_token, team_id=vercel_team_id)
# 2. tests/e2e/conftest.py:70
await delete_project(project_id=project_id, token=vercel_token, team_id=team_id)
# 3. tests/e2e/test_projects_e2e.py:339
await delete_project(project_id=project_id, token=vercel_token, team_id=vercel_team_id)Result: TypeError: delete_project() got an unexpected keyword argument 'project_id'
Expected: Should accept id_or_name= parameter as defined in the function signature (verified with correct usage in tests/e2e/test_projects_e2e.py:155 and :193)
| for asset in uploaded_assets: | ||
| blob_info = await head_async(asset["url"], token=blob_token) | ||
| assert blob_info.size == asset["size"] | ||
| assert blob_info.contentType == asset["content_type"] |
There was a problem hiding this comment.
| assert blob_info.contentType == asset["content_type"] | |
| assert blob_info.content_type == asset["content_type"] |
The code accesses blob_info.contentType but the HeadBlobResult dataclass uses snake_case attribute content_type, which will cause an AttributeError.
View Details
Analysis
Attribute name mismatch in HeadBlobResult access
What fails: Test assertion at line 267 in tests/integration/test_integration_e2e.py accesses blob_info.contentType which does not exist on the HeadBlobResult dataclass
How to reproduce:
# In test_integration_e2e.py, when test_project_integration_workflow() runs:
blob_info = await head_async(asset["url"], token=blob_token)
assert blob_info.contentType == asset["content_type"] # AttributeErrorResult: AttributeError: 'HeadBlobResult' object has no attribute 'contentType'
Expected: The HeadBlobResult dataclass (defined in src/vercel/blob/types.py at line 21) uses snake_case naming with attribute content_type, not camelCase contentType. The correct assertion is blob_info.content_type == asset["content_type"] (already used correctly at line 116 in the same file and throughout examples/blob_storage.py and tests/e2e/test_blob_e2e.py).
Note: camelCase contentType is correctly used for API payload field names when communicating with the server, but the Python dataclass consistently uses snake_case content_type for object attributes.
WIP - still testing