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

Wrong duration time while combine nightly tests reports #12256

Merged
merged 1 commit into from Jan 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 3 additions & 5 deletions tests/E2E/scripts/combine-reports.py
Expand Up @@ -51,7 +51,7 @@ def combine(self, report_dir):
raw_data = f.read()
try:
parsed_data = json.loads(raw_data)
except json.decoder.JSONDecodeError:
except ValueError:
# Could not load json file
continue

Expand Down Expand Up @@ -117,10 +117,8 @@ def write_report(self, obj, output):
'start': obj['start_time'],
'end': obj['end_time'],
'duration': int(
(
self.convert_to_datetime(obj['end_time']) - self.convert_to_datetime(obj['start_time'])
).total_seconds()
),
self.convert_to_datetime(obj['end_time']).timestamp() - self.convert_to_datetime(obj['start_time']).timestamp()
) * 1000,
'testsRegistered': obj['total_tests'] - obj['total_pending'],
'skipped': obj['total_skipped'],
'hasSkipped': obj['total_skipped'] > 0,
Expand Down
4 changes: 2 additions & 2 deletions tests/E2E/scripts/run-nightly-tests.sh
Expand Up @@ -26,7 +26,7 @@ git checkout $BRANCH
mkdir -p $REPORT_PATH

cd "${DIR_PATH}/prestashop/tests/E2E"
for test_directory in test/campaigns/full/* ; do
for test_directory in test/campaigns/full/*; do
if [ -d "${test_directory}" ]; then
docker volume prune -f
docker stop $(docker ps -qa)
Expand All @@ -48,7 +48,7 @@ for test_directory in test/campaigns/full/* ; do
fi
done

if [ "$(ls ${REPORT_PATH})" ]; then
if [ -n "$(ls ${REPORT_PATH})" ]; then
mkdir -p "${DIR_PATH}/reports"
./scripts/combine-reports.py "${REPORT_PATH}" "${REPORT_PATH}/${REPORT_OUTPUT_NAME}.json"
nodejs ./node_modules/mochawesome-report-generator/bin/cli.js "${REPORT_PATH}/${REPORT_OUTPUT_NAME}.json" -o "${DIR_PATH}/reports"
Expand Down