-
Notifications
You must be signed in to change notification settings - Fork 5
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
test: Fix transaction unit tests #425
Conversation
@vincentsarago are you able to help us with this PR? I think it's stumped all of Data Services so far 😬 We're mainly seeing a
Maybe it has something to do with how we're importing the app in our tests. |
os.environ["POSTGRES_HOST_READER"] = "database" | ||
os.environ["POSTGRES_HOST_WRITER"] = "database" | ||
os.environ["POSTGRES_HOST_READER"] = "0.0.0.0" | ||
os.environ["POSTGRES_HOST_WRITER"] = "0.0.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because we're outside the docker env, we cannot use short name database
if re.match( | ||
f"^{path_prefix}/collections(?:/[^/]+)?$", | ||
"^.*?/collections(?:/[^/]+)?$", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original regex with path_prefix wasn't working with the tests. Do we need path_prefix here or can we just include wildcard? @slesaad
request.url.path, | ||
): | ||
bulk_items = BulkItems(**request_data) | ||
for item_data in bulk_items.items.values(): | ||
validate_dict(item_data, STACObjectType.ITEM) | ||
except STACValidationError as e: | ||
except (STACValidationError, STACTypeError) as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Included STACTypeError in case someone enters some random dict
I deployed this to https://8ajdmuk7ld.execute-api.us-west-2.amazonaws.com/docs and tested the CREATE, PUT and POST transaction endpoints, and the validation is working. |
…lidation, add nlcd colormap (#434) **Breaking** feat(routes)!: remove cloudfront distribution and custom alternate domain from backend #422 **Added** feat(raster-api): added custom NLCD colormap #433 feat: add ecr endpoint #432 **Fixed** fix(tests): #425 fix(ingest): improved datetime validations #419 **Changed** ci: remove automated deployments to staging #438
I've added a small change in the
stac_api/runtime/tests/conftest.py
. This gives a similar error on each of the attempts to POST: The error error:this got past the starlette error that we were seeing in develop:
I'm at a loss on how to get past the new post error, though.
stephenkilbourn