Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing: Use tempdir instead of /tmp for e2elive test #1152

Merged
merged 2 commits into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion misc/e2elive.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def main():
psqlstring = ensure_test_db(args.connection_string, args.keep_temps)
algoddir = os.path.join(tempnet, 'Primary')
aiport = args.indexer_port or random.randint(4000,30000)
cmd = [indexer_bin, 'daemon', '--data-dir', '/tmp', '-P', psqlstring, '--dev-mode', '--algod', algoddir, '--server', ':{}'.format(aiport)]
cmd = [indexer_bin, 'daemon', '--data-dir', tempdir, '-P', psqlstring, '--dev-mode', '--algod', algoddir, '--server', ':{}'.format(aiport)]
logger.debug("%s", ' '.join(map(repr,cmd)))
indexerdp = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
indexerout = subslurp(indexerdp.stdout)
Expand Down
3 changes: 2 additions & 1 deletion misc/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def ensure_test_db(connection_string, keep_temps=False):

# whoever calls this will need to import boto and get the s3 client
def firstFromS3Prefix(s3, bucket, prefix, desired_filename, outdir=None, outpath=None):
response = s3.list_objects_v2(Bucket=bucket, Prefix=prefix, MaxKeys=10)
response = s3.list_objects_v2(Bucket=bucket, Prefix=prefix, MaxKeys=50)
if (not response.get('KeyCount')) or ('Contents' not in response):
raise Exception('nothing found in s3://{}/{}'.format(bucket, prefix))
for x in response['Contents']:
Expand All @@ -159,3 +159,4 @@ def firstFromS3Prefix(s3, bucket, prefix, desired_filename, outdir=None, outpath
logger.info('s3://%s/%s -> %s', bucket, x['Key'], outpath)
s3.download_file(bucket, x['Key'], outpath)
return
logger.info('file not found in s3://{}/{}'.format(bucket, prefix))
Copy link
Contributor

@brianolson brianolson Jul 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worth at least a warning if not error