From 36a95a61d6fa176c75583d8e217d851bfa0d09ef Mon Sep 17 00:00:00 2001 From: David Leong <116610336+leongdl@users.noreply.github.com> Date: Wed, 24 Jul 2024 14:51:46 -0700 Subject: [PATCH] feat: update DEVELOPMENT.md on how to run integ tests. Signed-off-by: David Leong <116610336+leongdl@users.noreply.github.com> --- .github/PULL_REQUEST_TEMPLATE.md | 3 +++ DEVELOPMENT.md | 22 +++++++++++++++++++ .../deadline_job_attachments/conftest.py | 3 ++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 07e5be9e9..15d5333d7 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -5,6 +5,9 @@ ### What is the impact of this change? ### How was this change tested? +- Have you run `hatch run test` ? + +- Have you run `hatch run integ:test` ? See `DEVELOPMENT.md` on "Run integration tests" ### Was this change documented? diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index f8b210386..3b250367f 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -54,10 +54,32 @@ hatch run test ``` ## Run integration tests +- Pre-requisites: + - Developer must have a valid AWS account. + - Developer must create a Farm, Queue. This can be done easily via Deadline Cloud's AWS Console quick farm create workflow. Please copy the Farm, Queue resource IDs for the next step. Please copy the Queue's Job Attachment S3 bucket name for the next step. + +- Setup Environment Variables +```bash +export SERVICE_ACCOUNT_ID="your AWS Account Id" +export JOB_ATTACHMENTS_BUCKET="your Queue configured Job Attachments bucket" +export JA_TEST_ROOT_PREFIX="/your/path/root" +export FARM_ID="farm-{uuid}" +export AWS_DEFAULT_REGION="us-west-2" +``` + +- Optional Environment Variables +```bash +export AWS_ENDPOINT_URL_DEADLINE="https://deadline.$AWS_DEFAULT_REGION.amazonaws.com" +export INTEG_TEST_JA_CROSS_ACCOUNT_BUCKET="Your regional S3 bucket in another account" +``` + +- Running the integration tests. ``` hatch run integ:test ``` +- Notes: + - If the integration test is run in any region other than `us-west-2`, please set the environment variable `INTEG_TEST_JA_CROSS_ACCOUNT_BUCKET`. The bucket must be from another AWS account in the same region as the farm setup to run this test. ## Run linting ``` hatch run lint diff --git a/test/integ/deadline_job_attachments/conftest.py b/test/integ/deadline_job_attachments/conftest.py index cc1656974..fa1f1bb4f 100644 --- a/test/integ/deadline_job_attachments/conftest.py +++ b/test/integ/deadline_job_attachments/conftest.py @@ -1,6 +1,7 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. import getpass +import os import json import sys import pytest @@ -98,7 +99,7 @@ def external_bucket() -> str: """ Return a bucket that all developers and test accounts have access to, but isn't in the testers account. """ - return "job-attachment-bucket-snipe-test" + return os.environ.get("INTEG_TEST_JA_CROSS_ACCOUNT_BUCKET", "job-attachment-bucket-snipe-test") def is_windows_non_admin():