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

Create user_resource in e2e tests #1952

Merged
merged 17 commits into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
28 changes: 27 additions & 1 deletion e2e_tests/test_workspace_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,25 @@ async def test_create_guacamole_service_into_base_workspace(admin_token, verify)

await post_resource(patch_payload, f'/api{workspace_service_path}', workspace_owner_token, verify, method="PATCH")

user_resource_payload = {
"templateName": "tre-service-guacamole-windowsvm",
"properties": {
"display_name": "My VM",
"description": "Will be using this VM for my research",
"os_image": "Windows 10"
}
}

user_resource_path, user_resource_id = await post_resource(user_resource_payload, f'/api{workspace_service_path}/{strings.API_USER_RESOURCES}', workspace_owner_token, verify, method="POST")

await disable_and_delete_resource(f'/api{user_resource_path}', workspace_owner_token, verify)

await disable_and_delete_resource(f'/api{workspace_service_path}', workspace_owner_token, verify)

await disable_and_delete_resource(f'/api{workspace_path}', admin_token, verify)


@pytest.mark.extended_aad
@pytest.mark.extended
@pytest.mark.timeout(3000)
async def test_create_guacamole_service_into_aad_workspace(admin_token, verify) -> None:
"""This test will create a Guacamole service but will create a workspace and automatically register the AAD Application"""
Expand Down Expand Up @@ -97,6 +110,19 @@ async def test_create_guacamole_service_into_aad_workspace(admin_token, verify)

await post_resource(patch_payload, f'/api{workspace_service_path}', workspace_owner_token, verify, method="PATCH")

user_resource_payload = {
"templateName": "tre-service-guacamole-windowsvm",
"properties": {
"display_name": "My VM",
"description": "Will be using this VM for my research",
"os_image": "Windows 10"
}
}

user_resource_path, user_resource_id = await post_resource(user_resource_payload, f'/api{workspace_service_path}/{strings.API_USER_RESOURCES}', workspace_owner_token, verify, method="POST")

await disable_and_delete_resource(f'/api{user_resource_path}', workspace_owner_token, verify)

await disable_and_delete_resource(f'/api{workspace_service_path}', workspace_owner_token, verify)

await disable_and_delete_resource(f'/api{workspace_path}', admin_token, verify)
2 changes: 2 additions & 0 deletions templates/core/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ TRE_ADDRESS_SPACE="10.0.0.0/12"
DEPLOY_GITEA=true
DEPLOY_NEXUS=true
RESOURCE_PROCESSOR_TYPE="vmss_porter"
API_APP_SERVICE_PLAN_SKU_SIZE="P1v2"
ross-p-smith marked this conversation as resolved.
Show resolved Hide resolved
APP_SERVICE_PLAN_SKU="P1v2"

# Auth configuration
# If you would like the workspace bundle to also create the AAD Workspace application
Expand Down