-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding integration tests for the upload script
- Loading branch information
1 parent
4a66eed
commit c44c559
Showing
14 changed files
with
82 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,6 @@ | |
*.egg-info | ||
.settings | ||
.idea | ||
mapillary_run_provider.yml | ||
docker/dockercontext/mapillary | ||
gitversion |
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,7 @@ | ||
#!groovy | ||
@Library('mapillary-pipeline') _ | ||
com.mapillary.pipeline.Pipeline.builder(this, steps) | ||
.defaultPipeline() | ||
.skipSystemStage() | ||
.build() | ||
.execute() |
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,13 @@ | ||
# MISC | ||
NAME = mapillary_tools | ||
|
||
# BOOT | ||
RUN_DIR=/mapillary_source | ||
RUN_CMD=script/run upload | ||
|
||
export | ||
|
||
DOCKER_CONTEXT=../ | ||
|
||
MAPILLARY_CLUSTER_DIR ?= /opt/mapillary_cluster | ||
include $(MAPILLARY_CLUSTER_DIR)/build/app/Makefile |
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,23 @@ | ||
FROM ubuntu:16.04 | ||
|
||
# SETUP | ||
RUN \ | ||
apt-get -qq update && \ | ||
apt-get -yqq install \ | ||
git \ | ||
python-pip && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN \ | ||
pip install --upgrade pip | ||
|
||
COPY . /source/mapillary_tools | ||
|
||
WORKDIR /source/mapillary_tools | ||
|
||
RUN pip install -r requirements.txt | ||
|
||
COPY docker/dockercontext/mapillary/ /mapillary | ||
|
||
ENV PATH="/mapillary:${PATH}" |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
-e . | ||
git+https://github.com/mapillary/Piexif | ||
git+https://github.com/mapillary/Piexif | ||
redis |
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,13 @@ | ||
#!/bin/bash | ||
|
||
source map_cluster_init | ||
|
||
if [ "$1" = "upload" ]; | ||
then | ||
map_cluster_wait_for_it $S3_WAIT | ||
while : | ||
do | ||
mapillary_tools upload --import_path tests/integration/mapillary_tools_upload_provider/data/ | ||
sleep 60 | ||
done | ||
fi |
Empty file.
Empty file.
Empty file.
Binary file added
BIN
+831 KB
tests/integration/mapillary_tools_upload_provider/data/2016_05_14_11_50_34_383.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.26 MB
...egration/mapillary_tools_upload_provider/data/2018_07_19_17_33_15_820_+0200.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
20 changes: 20 additions & 0 deletions
20
tests/integration/mapillary_tools_upload_provider/test_upload_provider.py
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,20 @@ | ||
import os | ||
from time import sleep | ||
|
||
from mapillary_messi.fixtures.psql_main_fixtures.psql_main_user_fixture import PsqlMainUserFixture | ||
from mapillary_messi.models import User | ||
from testtools import TestCase | ||
|
||
UPLOADED_FILENAME = "2016_05_14_11_50_34_383.jpg" | ||
|
||
class UploadProviderTestCase(TestCase): | ||
|
||
def test_images_uploaded_are_harvested(self): | ||
user_a = User() | ||
self.useFixture(PsqlMainUserFixture([user_a])) | ||
|
||
current_dir = os.path.abspath(__file__) | ||
data_dir = os.path.dirname(current_dir) | ||
image_path = os.path.join(data_dir, 'data/{}'.format(UPLOADED_FILENAME)) | ||
|
||
sleep(3000) |