mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-12 06:30:35 +00:00
allow s3 test in docker
read AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY from ./aws.creds when running: make docker-system-tests
This commit is contained in:
@@ -48,3 +48,5 @@ build/
|
|||||||
pgp/keyrings/aptly2*.gpg
|
pgp/keyrings/aptly2*.gpg
|
||||||
pgp/keyrings/aptly2*.gpg~
|
pgp/keyrings/aptly2*.gpg~
|
||||||
pgp/keyrings/.#*
|
pgp/keyrings/.#*
|
||||||
|
|
||||||
|
*.creds
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ docker-test: install
|
|||||||
@rm -f aptly.test
|
@rm -f aptly.test
|
||||||
go test -v -coverpkg="./..." -c -tags testruncli
|
go test -v -coverpkg="./..." -c -tags testruncli
|
||||||
@echo Running python tests ...
|
@echo Running python tests ...
|
||||||
|
@test -e aws.creds && . ./aws.creds; \
|
||||||
export PATH=$(BINPATH)/:$(PATH); \
|
export PATH=$(BINPATH)/:$(PATH); \
|
||||||
export APTLY_VERSION=$(VERSION); \
|
export APTLY_VERSION=$(VERSION); \
|
||||||
$(PYTHON) system/run.py --long $(TESTS) --coverage-dir $(COVERAGE_DIR) $(CAPTURE) $(TEST)
|
$(PYTHON) system/run.py --long $(TESTS) --coverage-dir $(COVERAGE_DIR) $(CAPTURE) $(TEST)
|
||||||
|
|||||||
+3
-1
@@ -8,7 +8,7 @@ try:
|
|||||||
if 'AWS_SECRET_ACCESS_KEY' in os.environ and 'AWS_ACCESS_KEY_ID' in os.environ:
|
if 'AWS_SECRET_ACCESS_KEY' in os.environ and 'AWS_ACCESS_KEY_ID' in os.environ:
|
||||||
s3_conn = boto.connect_s3()
|
s3_conn = boto.connect_s3()
|
||||||
else:
|
else:
|
||||||
print("S3 tests disabled: AWS creds not found in the environment")
|
print("S3 tests disabled: AWS creds not found in the environment (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)")
|
||||||
s3_conn = None
|
s3_conn = None
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
print("S3 tests disabled: can't import boto", e)
|
print("S3 tests disabled: can't import boto", e)
|
||||||
@@ -32,6 +32,8 @@ class S3Test(BaseTest):
|
|||||||
"test1": {
|
"test1": {
|
||||||
"region": "us-east-1",
|
"region": "us-east-1",
|
||||||
"bucket": self.bucket_name,
|
"bucket": self.bucket_name,
|
||||||
|
"awsAccessKeyID": os.environ["AWS_ACCESS_KEY_ID"],
|
||||||
|
"awsSecretAccessKey": os.environ["AWS_SECRET_ACCESS_KEY"]
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user