-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: add integration tests #69
Conversation
4494c2e
to
b8c14a8
Compare
b8c14a8
to
1300c4e
Compare
Anybody would like to take another look ? The action is running fine (I ran them manually to remove any bug). Here is a gist of what's happening :
It takes a while, almost an hour from scratch :
For another time I'd like to figure out how to cache all the lambda runtime builds but it's a rabbit hole.... |
@vincentsarago @sharkinsspatial, following-up on a discussion I had with Vincent on Slack. There is a concern regarding the fact that we are going to run the
|
eoapi-template will have to be modified on every release because we are using direct version pinning in eoapi-template (https://github.com/developmentseed/eoapi-template/blob/main/requirements.txt#L3) I personally having circular dependency with external repo is dangerous is will required more work (e.g if someone change something in eoapi-cdk but has no idea what is eoapi-template is, they might open a PR and wait for someone to review, which mean that the reviewer might have to review two PR in two different repo. I do agree that eoapi-template should be the official demo application but I do not agree that we have to keep 1:1 with the versions.
Because the purpose of eoapi-template is to be a repository template, I think we should could it separate. IMO it will be fine to just copy/paste what application we have in eoapi-cdk test suite to eoapi-template |
👍 |
…t we dont depend on an external repository. Modify accordingly the tests folder, with two subfolders (tests and cdk code) and the top folder renamed to integration_tests
981ad75
to
b2ca50d
Compare
b2ca50d
to
80f03ba
Compare
@vincentsarago made the changes, the tests here use their own wrapper CDK code. Looks like I adressed your main requests, anything else ? Once the action succeeded I will turn off the |
.github/workflows/deploy.yaml
Outdated
python -m venv .deployment_venv | ||
source .deployment_venv/bin/activate | ||
pip install -r requirements.txt | ||
pip install --upgrade eoapi-cdk # make sure to take the latest version of eoapi-cdk since we're integration-testing the newest release. |
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.
Are we testing the latest available version on pypi or the one in this repo?
It might be dangerous
to test the version on pypi because there could be a lag
from the push to the publication
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.
Ah nice catch, I hadn't thought of the lag possibility...
However, I'd have to compile the typescript constructs locally to have access to the python modules.
How about setting up this workflow so that it waits (with a timeout) for the latest pypi to match for the latest github tag?
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.
How about setting up this workflow so that it waits (with a timeout) for the latest pypi to match for the latest github tag?
Sure, but then what will it means if the tests fails?
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.
Ah 🤦♂️ doesn't make much sense indeed. We should be doing
build -> integration test -> release
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.
lets see if @sharkinsspatial or @alukach have opinions
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.
Could be missing something from the CI logic, but one way to do it could be to add a job
named integration-test
here that reuses the package
job's output. We then add integration-test
as a dependency to both subsequent distribute-*
jobs so that we're sure releases happen only if integration-tests ran.
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.
FYI, to illustrate the idea, I pushed another commit (can always revert). See 4ff82c2
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.
Thanks @emileten |
701d85f
to
4ff82c2
Compare
31a6845
to
01816fe
Compare
Making progress on this, now I am trying to figure out why I get a TimeOutError from httpx in the bootstrapper. Because this bootstrapper runs fine on my local machine, my guess is that the bootstrapper lambda doesn't have access to the internet because of accidental configuration changes I made ; in particular, I removed Doesn't seem to be solving the problem, though. Edit : oh I know what's going on - I was placing things in private subnets. I'll simplify the setup in the test to mimic https://github.com/developmentseed/eoAPI/tree/main/infrastructure/aws/cdk. |
01816fe
to
64e67b7
Compare
9bd845b
to
db7662f
Compare
… trigger to check the action works
db7662f
to
92cec0d
Compare
…assets into another directory to avoid conflicts
# [7.0.0](v6.1.0...v7.0.0) (2024-02-22) ### Features * add integration tests ([#69](#69)) ([17eec16](17eec16)) ### BREAKING CHANGES * clients need to provide aws_lambda.AssetCode to configure their apps. Solely the python application and the requirements.txt file is not supported anymore. * fix a couple bugs found in the first changes * avoid maintaining custom interfaces for configurable lambda properties. Allow the user to provide anything and let the CDK method raise error and overwrite values defined within our construct. Make this clear in the documentation * expose bootstrapper props in pgstacdatabase construct constructor * merge database and boostrapper files to solve casting bug * bump and harmonize pypgstac to 0.7.10 across apps * bump cachetools * some changes to allow for less security * bump python to 3.11 * change base image for bootstrapper to use python 311 * fix linting issues * move integration tests to step before release, improve naming of workflows * lint * fix moto requirement * test to fix deployment : try adding s3 endpoint and force allow public subnet * lint and make lambda functions more configurable * moving deploy to a separate workflow * remove useless dependencies in deployment tests, turn on pull request trigger to check the action works * when tearing down the infrastructure, synthesize the cloud formation assets into another directory to avoid conflicts * update readmes and revive the artifact download in python distribution
closes #13
second take at #67