Skip to content

Commit

Permalink
Merge pull request #316 from wri/GTC-1893-hardcoded-ms-s3-port
Browse files Browse the repository at this point in the history
chore(test environment): GTC-1893 Allow user to explicitly set motoserver port
  • Loading branch information
gtempus authored Jun 28, 2022
2 parents 8a9b085 + e0aa82a commit b00de9c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ High-performance Async REST API, in Python. FastAPI + GINO + Uvicorn (powered by
### Developing
* Generate a DB Migration: `./scripts/migrate` (note `app/settings/prestart.sh` will run migrations automatically when running `/scripts/develop`)
* Run tests: `./scripts/test`
* `--no_build` - don't rebuild the containers
* `--moto-port=<port_number>` - explicitly sets the motoserver port (default `5000`)
* Run specific tests: `./scripts/test tasks/test_vector_source_assets.py::test_vector_source_asset`
* Debug memory usage of Batch jobs with memory_profiler:
1. Install memory_profiler in the job's Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ services:
container_name: motoserver-s3
image: motoserver/moto:2.0.10
ports:
- 5000:5000
- "${MOTO_PORT-5000}:5000"
entrypoint: moto_server s3 -H 0.0.0.0
restart: on-failure

Expand Down
6 changes: 6 additions & 0 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ do
SLOW=--with-slow-tests
shift # past argument
;;
--moto-port=*)
# prevent port binding issues by explicitly setting the motoserver s3 port
# https://developer.apple.com/forums/thread/682332
export MOTO_PORT="${key#*=}"
shift # past argument=value
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
Expand Down

0 comments on commit b00de9c

Please sign in to comment.