Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1246 from tilezen/update-integration-test-coordin…
…ates Update test coordinates on master builds
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |