Skip to content

Commit 74c103a

Browse files
committed
configure for codebuild pr builds
1 parent 0a7a532 commit 74c103a

File tree

3 files changed

+33
-10
lines changed

3 files changed

+33
-10
lines changed

buildspec.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: 0.2
2+
3+
phases:
4+
pre_build:
5+
commands:
6+
- start-dockerd
7+
8+
build:
9+
commands:
10+
# run linters
11+
- tox -e flake8,pylint
12+
13+
# run package and docbuild checks
14+
- tox -e twine
15+
- tox -e sphinx
16+
17+
# run unit tests
18+
- AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN=
19+
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI= AWS_DEFAULT_REGION=
20+
tox -e py27,py36 -- tests/unit
21+
22+
# run integration tests
23+
# TODO add missing 'do we need integ tests' check
24+
- IGNORE_COVERAGE=- tox -e py27,py36 -- -n 24 --boxed tests/integ

tests/integ/kms_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"Sid": "Enable IAM User Permissions",
2323
"Effect": "Allow",
2424
"Principal": {{
25-
"AWS": "arn:aws:iam::{account_id}:root"
25+
"AWS": "{account_id}"
2626
}},
2727
"Action": "kms:*",
2828
"Resource": "*"
@@ -31,7 +31,7 @@
3131
"Sid": "Allow use of the key",
3232
"Effect": "Allow",
3333
"Principal": {{
34-
"AWS": "arn:aws:iam::{account_id}:role/SageMakerRole"
34+
"AWS": "{account_id}"
3535
}},
3636
"Action": [
3737
"kms:Encrypt",
@@ -46,7 +46,7 @@
4646
"Sid": "Allow attachment of persistent resources",
4747
"Effect": "Allow",
4848
"Principal": {{
49-
"AWS": "arn:aws:iam::{account_id}:role/SageMakerRole"
49+
"AWS": "{account_id}"
5050
}},
5151
"Action": [
5252
"kms:CreateGrant",

tox.ini

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@
44
# and then run "tox" from this directory.
55

66
[tox]
7-
envlist = py27,py35,flake8,pylint,twine,sphinx
7+
envlist = flake8,pylint,twine,sphinx,py27,py36
88

99
skip_missing_interpreters = False
1010

11-
[travis]
12-
python =
13-
3.5: py35, flake8, pylint
1411

1512
[flake8]
1613
max-line-length = 120
@@ -24,7 +21,9 @@ exclude =
2421
tests/data/
2522
venv/
2623
*service_pb2_grpc.py
24+
2725
max-complexity = 10
26+
2827
ignore =
2928
FI10,
3029
FI12,
@@ -46,13 +45,13 @@ ignore =
4645
require-code = True
4746

4847
[testenv]
49-
# TEAMCITY_VERSION environment variable exists during build on Teamcity. teamcity-messages uses it in order to enable
50-
# reporting to TeamCity.
5148
passenv =
52-
TEAMCITY_VERSION
5349
AWS_ACCESS_KEY_ID
5450
AWS_SECRET_ACCESS_KEY
5551
AWS_SESSION_TOKEN
52+
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
53+
AWS_DEFAULT_REGION
54+
5655
# {posargs} can be passed in by additional arguments specified when invoking tox.
5756
# Can be used to specify which tests to run, e.g.: tox -- -s
5857
commands =

0 commit comments

Comments
 (0)