Skip to content

bosh unit test failed with non matching SQL error message #7

Description

@weilanwu

bundle exec rake :
...

  1) Bosh::Director::Models::DirectorAttribute validations does not allow attribute with name if one is already found via database (DB uniqueness is important since we rely that only one uuid is used by the director)
     Failure/Error: Unable to find matching line from backtrace
       expected Sequel::DatabaseError with message matching /column name is not unique/, got #<Sequel::DatabaseError: SQLite3::ConstraintException: UNIQUE constraint failed: director_attributes.name> with backtrace:
         # ./bosh/bosh-director/spec/unit/models/director_attribute_spec.rb:112:in `block (4 levels) in '
         # ./bosh/bosh-director/spec/unit/models/director_attribute_spec.rb:111:in `block (3 levels) in '
     # ./bosh/bosh-director/spec/unit/models/director_attribute_spec.rb:111:in `block (3 levels) in '

Basically the code looks for '/column name is not unique/', but the output from DB is:
'#<Sequel::DatabaseError: SQLite3::ConstraintException: UNIQUE constraint failed: director_attributes.name>'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions