run_tests fails with unclear error when wrong path to test is specified

Bug #1397916 reported by Sebastian Kalinowski
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Low
Julia Varigina

Bug Description

In fuel-web, when running selected test using run_tests.sh scipt and path to nonexistent file is specified, unclear error message is thrown:

# ./run_test.sh -t some/fake/path.py
./run_tests.sh: line 604: $1: unbound variable

It's because there is no checking if readlink returned anything: https://github.com/stackforge/fuel-web/blob/09089099c369a13b47badab6a077c5edc353e942/run_tests.sh#L136-L137

There should be a error instead, like:
"File some/fake/path.py not found"

Changed in fuel:
status: New → Confirmed
tags: added: low-hanging-fruit
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Julia Varigina (jvarigina)
Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

Fix proposed to branch: master
Review: https://review.openstack.org/141076

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/141076
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=c3df5c2b52491296f74a329f668c9bd4085192b8
Submitter: Jenkins
Branch: master

commit c3df5c2b52491296f74a329f668c9bd4085192b8
Author: Julia Varigina <email address hidden>
Date: Thu Dec 11 07:43:14 2014 -0800

    Print descriptive error message if test file does not exist

    Added verification that test file or directory exists for the command:
    run_tests.sh -t <test file>

    If a test file (or directory) does not exist, run_tests.sh prints error message:
    ERROR: File or directory <test file> not found
    and exits with status 1

    Change-Id: Ia0b11efe434daf7f040943ea8622bad496074563
    Closes-Bug: #1397916

Changed in fuel:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.