Created
March 31, 2020 15:16
-
-
Save szczeles/c05209c0b5cd5a6bffd8159a788cd676 to your computer and use it in GitHub Desktop.
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
import subprocess | |
class TestIntegration(unittest.TestCase): | |
def test_enrichment(self): | |
# given | |
self.add_event( | |
ts=datetime(2020, 3, 31, 13, 15), | |
user_id='USER1', | |
ad_id='AD1') | |
self.add_ad( | |
id='AD1', | |
name='Sample ad' | |
) | |
# when | |
exit_code = self.run_app("2020-03-31") | |
### TODO | |
def run_app(self, date): | |
return subprocess.run( | |
[ | |
"spark-submit", | |
"--conf","spark.sql.shuffle.partitions=1", | |
"job.py", | |
"--dt", date, | |
"--input-events", self.INPUT_EVENTS, | |
"--input-ads", self.INPUT_ADS, | |
"--output-joined", self.OUTPUT_JOINED, | |
"--output-invalid", self.OUTPUT_INVALID | |
], | |
stderr=subprocess.DEVNULL, | |
).returncode | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment