Menu

Importing Test Case from CSV causes "Oops..." UnboundLocalError

Help
2013-01-09
2013-01-16
  • Kevin P. Grelling

    Get an "Oops..." error when trying to load a simple (title and description only) test case:

    Trac detected an internal error:
    UnboundLocalError: local variable 'target_file' referenced before assignment

     
  • Kevin P. Grelling

    Attached is a pdf of the resulting error screen.

    Any help would be appreciated!

    Thanks.

     

    Last edit: Kevin P. Grelling 2013-01-09
  • Kevin P. Grelling

    REPAIRED.

    I seem to have repaired my setup it by reintalling trac and testmanager from scratch and restoring a pre-testmanager backup of the db. The exact same csv file now imports as a testcase without problem.

    Just FYI: My test engineers were investigating testmanager's usage scenario and more than once did something that messed up what they were trying to do (like having misspelled field names or field name's with commas in it in their imported CSV files). I attempted to fix things using sqlite directly on the db file and probably (undoubtedly) messed it up.

    I don't want these posts to make people "think again" about using testmanager. It appears to be a very capable plugin for trac. However, I would suggest a little more error checking during CSV import - and possibly the ability to disable automatic field generation completely in the trac.ini file. I personally would prefer defining the columns in the trac.ini file beforehand and then insisting that any imported CSV's meet that specification before messing up the db.

    This is all coming to pass because we are importing quite a few already existing test scenarios into TestManager and none of our engineers had to be particularly careful about spelling before.

    Just my 2c.

    But overall, this plugin meets our needs very well and I want to insure that we send our thanks, Roberto, for this excellent trac add-on!

     
  • Roberto Longobardi

    Hi Kevin,
    I agree that the import functionality should be more strict about what's being imported.

    Maybe I should add a dry run functionality, which shows what is goig to be done before actually committing the job, expecially in terms of the custom fields that are going to be added.

    I'll file an enhancement ticket on trac-hacks for this.

    Thanks for the kudos :D

    Ciao,
    Roberto

     
  • Roberto Longobardi

    Here's the ticket: https://trac-hacks.org/ticket/10801

    Subscribe to it to be alerted as soon as it will be implemented.

    Ciao,
    Roberto

     

Log in to post a comment.