Skip to content

Commit

Permalink
Merge pull request #1246 from tilezen/update-integration-test-coordin…
Browse files Browse the repository at this point in the history
…ates

Update test coordinates on master builds
  • Loading branch information
rmarianski committed May 11, 2017
2 parents 2a4d03e + 0fffea0 commit 001a054
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions circle.yml
Expand Up @@ -29,6 +29,7 @@ deployment:
commands:
- pip install 'Circle-Beacon == 2.0.0'
- alert-circle mapzen documentation master $CIRCLE_TOKEN
- ./scripts/update-integration-test-coordinates.sh
release:
tag: /.+/
commands:
Expand Down
31 changes: 31 additions & 0 deletions scripts/update-integration-test-coordinates.py
@@ -0,0 +1,31 @@
from boto import connect_s3
from boto.s3.bucket import Bucket
from tilequeue.tile import deserialize_coord
from tilequeue.tile import serialize_coord
import fileinput


bucket_name = 'mapzen-tiles-assets'
key_name = 'test/integration-test-coords.txt'


coords_to_store = set()
for line in fileinput.input():
coord = deserialize_coord(line.strip())
assert coord
if coord.zoom == 0:
uplifted_coord = coord
else:
uplifted_coord = coord.zoomBy(-1).container()
coords_to_store.add(uplifted_coord)

sorted_coords = sorted(coords_to_store)
coords_str = '\n'.join(map(serialize_coord, sorted_coords))

conn = connect_s3()
bucket = Bucket(conn, bucket_name)
key = bucket.new_key(key_name)
key.set_contents_from_string(
coords_str,
headers={'Content-Type': 'text/plain'},
)
5 changes: 5 additions & 0 deletions scripts/update-integration-test-coordinates.sh
@@ -0,0 +1,5 @@
#!/bin/bash

basedir="$(dirname ${BASH_SOURCE[0]})/.."

python ${basedir}/integration-test.py -printcoords | python ${basedir}/scripts/update-integration-test-coordinates.py

0 comments on commit 001a054

Please sign in to comment.