Skip to content
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

[Feature]: Testing - Checkpoint 1 (SDK - management, routing, cli) #2382

Open
wants to merge 28 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7d2ad40
feat (sdk:tests): create pytest configuration
aybruhm Dec 18, 2024
f0441db
feat (sdk:tests): add fixtures for HTTP client and app setup, ensure …
aybruhm Dec 18, 2024
5637d9a
feat (sdk:tests): create variant manager test suite (in progress)
aybruhm Dec 18, 2024
56dd757
chore (sdk:tests): add bash script to run tests in sdk
aybruhm Dec 18, 2024
645a276
chore (deps): add mypy and pytest-xdist dev dependencies to agenta-cli
aybruhm Dec 19, 2024
1ab5da6
refactor (backend): add optional attribute field to AppVariantRevisio…
aybruhm Dec 19, 2024
72a876e
chore (tests): update pytest configuration
aybruhm Dec 19, 2024
8d43c12
refactor (sdk:tests): add saltiness to name generation for app from t…
aybruhm Dec 19, 2024
68e5924
refactor (sdk:tests): update marker to `variant_manager` and remove `…
aybruhm Dec 19, 2024
c125d03
feat (sdk:tests): add fixture for Deployment Manager test suites and …
aybruhm Dec 19, 2024
dc5db1b
feat (sdk:tests): add more test cases to VariantManager test suite.
aybruhm Dec 19, 2024
035c056
feat (sdk:tests): add fixture for Config Manager test suites and crea…
aybruhm Dec 19, 2024
a4ddab1
chore (backend): add variant_revision id in `app_variant_db_revisions…
aybruhm Dec 19, 2024
eec75b3
feat (sdk:tests): add fixture for SDK routing test suites and create …
aybruhm Dec 20, 2024
9f6271b
chore (sdk:tests): add markers for config_manager and sdk_routing tes…
aybruhm Dec 20, 2024
7b7d8f7
chore (deps): add uvicorn to dev dependencies in agenta-cli
aybruhm Dec 20, 2024
e741644
refactor (backend): retrieve api_key from headers properly
aybruhm Dec 20, 2024
b0a1948
refactor (sdk:tests): add command to run sdk_routing test suites
aybruhm Dec 20, 2024
e05a72a
style (backend): format backend
aybruhm Dec 20, 2024
afe804e
minor refactor (sdk:tests): rename fixture to get executable_python
aybruhm Dec 20, 2024
c862cbd
refactor (sdk:tests): update bash script to dynamically request for v…
aybruhm Dec 23, 2024
078cb64
refactor (sdk:tests): add marker for cli_testing
aybruhm Dec 23, 2024
8e8f9fa
feat (sdk:tests): add required fixtures required to run cli commands …
aybruhm Dec 23, 2024
d65f0fb
feat (sdk:tests): add assets required to run the cli tests
aybruhm Dec 23, 2024
97b1bb2
feat (sdk:tests): create TestAgentaInitCommand and TestAgentaVariantS…
aybruhm Dec 23, 2024
59829b8
Merge branch 'dev' into feature/sdk-management-checkpoint-1
aybruhm Dec 24, 2024
e492d70
refactor (sdk:tests): add and integrated fixtures for programmatic ac…
aybruhm Dec 25, 2024
9336875
refactor (sdk:tests): add test case for grumpy path --- serve variant…
aybruhm Dec 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions agenta-backend/agenta_backend/models/api/api_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class AppVariantResponse(BaseModel):


class AppVariantRevision(BaseModel):
id: Optional[str] = None
revision: int
modified_by: str
config: ConfigDB
Expand Down
2 changes: 2 additions & 0 deletions agenta-backend/agenta_backend/models/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ async def app_variant_db_revisions_to_output(
for app_variant_revision_db in app_variant_revisions_db:
app_variant_revisions.append(
AppVariantRevision(
id=str(app_variant_revision_db.id) or None,
revision=app_variant_revision_db.revision,
modified_by=app_variant_revision_db.modified_by.username,
config={
Expand All @@ -334,6 +335,7 @@ async def app_variant_db_revision_to_output(
app_variant_revision_db: AppVariantRevisionsDB,
) -> AppVariantRevision:
return AppVariantRevision(
id=str(app_variant_revision_db.id) or None,
revision=app_variant_revision_db.revision,
modified_by=app_variant_revision_db.modified_by.username,
config=ConfigDB(
Expand Down
7 changes: 5 additions & 2 deletions agenta-backend/agenta_backend/routers/app_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,13 @@ async def create_app(
"""
try:
if isCloudEE():
api_key_from_headers = request.headers.get("Authorization")
api_key_from_headers = request.headers.get("Authorization", None)
if api_key_from_headers is not None:
api_key = api_key_from_headers.split(" ")[
-1
] # ["ApiKey", "xxxxx.xxxxxx"]
await check_apikey_action_access(
api_key_from_headers,
api_key,
request.state.user_id,
Permission.CREATE_APPLICATION,
)
Expand Down
5 changes: 5 additions & 0 deletions agenta-cli/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# rename [environ] to the environment you're working/testing on
# for local, rename it to local --- .env.local
_SECRET_KEY=xxxxxxx
AWS_PROFILE_NAME=xxxxxxxxxx
AGENTA_AUTH_KEY_SECRET_ARN=xxxxxxxxxxxxx
233 changes: 230 additions & 3 deletions agenta-cli/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions agenta-cli/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ setuptools = "^71.1.0"

[tool.poetry.group.dev.dependencies]
pytest-asyncio = "^0.24.0"
mypy = "^1.13.0"
pytest-xdist = "^3.6.1"
uvicorn = "^0.34.0"
requests = "^2.32.3"
pexpect = "^4.9.0"
boto3 = "^1.35.87"

[tool.pytest.ini_options]
asyncio_default_fixture_loop_scope = "function"
Expand Down
Empty file added agenta-cli/tests/__init__.py
Empty file.
Empty file.
Empty file.
Empty file.
Loading
Loading