Skip to content
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

Allow easily running tests against AWS #482

Merged
merged 4 commits into from Oct 16, 2018

Conversation

tiago-loureiro
Copy link
Contributor

Currently we tend to test things only against fake/mocked AWS services; while this is nice from a feedback loop point of view, it would also be helpful to be able to test things against the actual AWS API and get that sort of feedback sooner rather than later.

This PR intends to streamline that workflow making some assumptions:

  • Defined in the environment: AWS_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY. This AWS_ACCESS_KEY_ID has access to the resources specified in the configuration files
  • Access to a file with default settings to override settings in each service's config options. This file can either be downloaded from S3 (if you provide a path to it) or just added locally
  • Whatever AWS resources used, they must be created beforehand

If the preconditions are met, one can simply run make i-aws which is equivalent to make integration except that it attempts to use real AWS resources instead.

@neongreen neongreen changed the title Allow easily runnings tests against AWS Allow easily running tests against AWS Oct 9, 2018
Copy link
Member

@jschaul jschaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the current config, galley tests fail with

   post cryptomessage 1:                                        [brig] E, request=N/A, GeneralError (TransportError (HttpExceptionRequest Request {
[brig]   host                 = "localhost"
[brig]   port                 = 4569
[brig]   secure               = False

(i.e. brig is trying to connect to localhost here, but I don't run the fake-AWS services locally). The configuration doesn't seem right.

@@ -64,6 +64,10 @@ $(DEB_IT):
i:
../integration.sh $(EXE_IT) -s $(NAME).integration.yaml -i ../integration.yaml

.PHONY: i-aws
i-aws:
INTEGRATION_USE_REAL_AWS=1 ../integration.sh $(EXE_IT) -s $(NAME).integration.yaml -i ../integration.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend to use -s $(NAME).integration-aws.yaml ? The script writes merges and writes to that file, but the Makefile doesn't use that. (same for all the Makefiles)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Erm, yeah... rebase gone wrong :/ should be all green now

then
echo "Could not find AWS config file to override settings, specify a location on S3 to download the file or add one at ${DIR}/integration-aws.yaml and retry: "
read location
aws s3 cp s3://$location .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incorrect path. Should be aws s3 cp s3://$location "${DIR}/integration-aws.yaml"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jschaul
Copy link
Member

jschaul commented Oct 9, 2018

Also, there are a few warnings in the bash script when running shellcheck on it.

@tiago-loureiro
Copy link
Contributor Author

Also, there are a few warnings in the bash script when running shellcheck on it.

Oh nice one, thanks for the tip.

@tiago-loureiro
Copy link
Contributor Author

Should be much cleaner now, assumes that the integration-aws.yaml file is scoped per service (example added too).

Copy link
Member

@jschaul jschaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@tiago-loureiro tiago-loureiro merged commit 1871e8a into develop Oct 16, 2018
@tiago-loureiro tiago-loureiro deleted the easy-testing-against-aws branch October 16, 2018 14:25
@fisx fisx mentioned this pull request Oct 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants