Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Type
Summary
The idea is to use moto to run functional tests.
This first commit provide the feature to use a custom Endpoint Url using the environment variable
AWS_ENDPOINT_URL
.Current moto version is missing some feature/methods needed by AutoSpotting, so i have added them to my working fork:
https://github.com/mello7tre/moto/tree/mello-feats-and-fixes-01
i will open PRs to merge them in moto master branch.
Until merged, you can install my current fork using the command:
pip3 install git+https://github.com/mello7tre/moto.git@mello-feats-and-fixes-01#egg=moto[ec2,autoscaling,server]
(warning overwrite any current moto installation)
You can then run moto server using command:
moto_server
Once running you can create a base infrastructure for AutoSpotting using any language that you like, configuring it to use the moto local endpoint.
As example, in python you can create ec2 and autoscaling services using:
Once created the infrastructure you can run a local AutoSpotting executable like:
AWS_ENDPOINT_URL="http://127.0.0.1:5000/" /opt/AutoSpotting-build/build/dist/AutoSpotting -allowed_instance_types current -regions us-east-1 -tag_filters "spot-enabled=true" -event_file /opt/AutoSpotting-build/event_cron.json
where
event_cron.json
is like:In following posts, when we will choose how to implement them, i will add scripts to create the infrastructure and run the tests.
Moto support sqs and lambda too, but i doubt that it will be able to fully support a complete AutoSpotting workflow (
CW -> Lambda -> SQS -> Lambda
).So the idea is to create ad hoc events file and tests the specific event, simulating events originating from both SQSQueue and CloudWatch Events.
Now that spot request, launch and following ondemand replacement is done all in one step, is easy to accomplish this.
Code contribution checklist
code under any software license.
to it.
guidelines.
test coverage doesn't decrease.
make full-test
.variables which are also passed as parameters to the
CloudFormation
and
Terraform
stacks defined as infrastructure code.
support per-group overrides using tags.
configurations.
proven to work using log output from various test runs.
appropriate) and formatted consistently to the existing log output.
new configuration options for both stack parameters and tag overrides.
contribution actually resolves it.