Skip to content

Commit

Permalink
Update Developer Guide how to run integ tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leongdl committed Jul 24, 2024
1 parent 950cd1a commit 1cefaf2
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,29 @@ hatch run test
```

## Run integration tests

- Setup Environment Variables
```bash
export SERVICE_ACCOUNT_ID=001122334455
export JOB_ATTACHMENTS_BUCKET="{deadline queue configured Job Attachments S3 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.{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 enviornment 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 All @@ -73,6 +92,9 @@ hatch run fmt
hatch run all:test
```

## Running Job Attachments Integration tests.


## Qt and Calling AWS (including AWS Deadline Cloud) APIs

> TL;DR Never call an AWS API from the main Qt event loop. Always run it in a separate thread,
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 1cefaf2

Please sign in to comment.