Skip to content

Commit

Permalink
feat: update DEVELOPMENT.md on how to run integ tests.
Browse files Browse the repository at this point in the history
Signed-off-by: David Leong <[email protected]>
  • Loading branch information
leongdl committed Jul 24, 2024
1 parent 950cd1a commit 36a95a6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down
22 changes: 22 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion test/integ/deadline_job_attachments/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

import getpass
import os
import json
import sys
import pytest
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit 36a95a6

Please sign in to comment.