Bug #417

tests failing in api-current @80da654

Added by Vangelis Koukis over 13 years ago. Updated over 13 years ago.

Status:Closed Start date:04/13/2011
Priority:High Due date:
Assignee:Giorgos Verigakis % Done:

0%

Category:Cyclades API Spent time: -
Target version:v0.2

Description

Τα tests αποτυγχάνουν με MySQL backend στο branch api-current, 80da654.

Associated revisions

Revision 53b1eea6
Added by Giorgos Verigakis over 13 years ago

Improve metadata tests

Refs: 417

Revision 7317d130
Added by Giorgos Verigakis over 13 years ago

Fix API calls that depend on specific server ids

Fixes #417

History

#1 Updated by Vangelis Koukis over 13 years ago

Log από τον test runner:

Installing json fixture 'initial_data' from '/home/devel/synnefo/../synnefo/db/fixtures'.
Installed 1 object(s) from 1 fixture(s)
.....................FFF.EE..E....FF.E ======================================================================
ERROR: test_update_metadata (synnefo.api.tests.CreateServerMetadataItem)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/devel/synnefo/../synnefo/api/tests.py", line 547, in test_update_metadata
key = choice(metadata.keys())
File "/usr/lib/python2.6/random.py", line 261, in choice
return seq[int(self.random() * len(seq))] # raises IndexError if seq is empty
IndexError: list index out of range

======================================================================
ERROR: test_delete_metadata (synnefo.api.tests.DeleteServerMetadataItem)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/devel/synnefo/../synnefo/api/tests.py", line 582, in test_delete_metadata
key = choice(metadata.keys())
File "/usr/lib/python2.6/random.py", line 261, in choice
return seq[int(self.random() * len(seq))] # raises IndexError if seq is empty
IndexError: list index out of range

======================================================================
ERROR: test_get_metadata_item (synnefo.api.tests.GetServerMetadataItem)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/devel/synnefo/../synnefo/api/tests.py", line 503, in test_get_metadata_item
key = choice(metadata.keys())
File "/usr/lib/python2.6/random.py", line 261, in choice
return seq[int(self.random() * len(seq))] # raises IndexError if seq is empty
IndexError: list index out of range

======================================================================
ERROR: test_update_metadata (synnefo.api.tests.UpdateServerMetadata)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/devel/synnefo/../synnefo/api/tests.py", line 468, in test_update_metadata
for key in sample(metadata.keys(), 3):
File "/usr/lib/python2.6/random.py", line 316, in sample
raise ValueError, "sample larger than population"
ValueError: sample larger than population

======================================================================
FAIL: test_create_metadata (synnefo.api.tests.CreateServerMetadataItem)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/devel/synnefo/../synnefo/api/tests.py", line 541, in test_create_metadata
self.create_meta(meta)
File "/home/devel/synnefo/../synnefo/api/tests.py", line 532, in create_meta
self.assertEqual(response.status_code, 201)
AssertionError: 404 != 201

======================================================================
FAIL: test_invalid_data (synnefo.api.tests.CreateServerMetadataItem)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/devel/synnefo/../synnefo/api/tests.py", line 573, in test_invalid_data
self.assertBadRequest(response)
File "/home/devel/synnefo/../synnefo/api/tests.py", line 412, in assertBadRequest
self.assertFault(response, 400, 'badRequest')
File "/home/devel/synnefo/../synnefo/api/tests.py", line 407, in assertFault
self.assertEqual(response.status_code, status_code)
AssertionError: 404 != 400

======================================================================
FAIL: test_invalid_key (synnefo.api.tests.CreateServerMetadataItem)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/devel/synnefo/../synnefo/api/tests.py", line 566, in test_invalid_key
self.assertBadRequest(response)
File "/home/devel/synnefo/../synnefo/api/tests.py", line 412, in assertBadRequest
self.assertFault(response, 400, 'badRequest')
File "/home/devel/synnefo/../synnefo/api/tests.py", line 407, in assertFault
self.assertEqual(response.status_code, status_code)
AssertionError: 404 != 400

======================================================================
FAIL: test_does_not_create (synnefo.api.tests.UpdateServerMetadata)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/devel/synnefo/../synnefo/api/tests.py", line 478, in test_does_not_create
response_metadata = self.update_meta(new_metadata)
File "/home/devel/synnefo/../synnefo/api/tests.py", line 460, in update_meta
self.assertEqual(response.status_code, 201)
AssertionError: 404 != 201

======================================================================
FAIL: test_invalid_data (synnefo.api.tests.UpdateServerMetadata)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/devel/synnefo/../synnefo/api/tests.py", line 486, in test_invalid_data
self.assertBadRequest(response)
File "/home/devel/synnefo/../synnefo/api/tests.py", line 412, in assertBadRequest
self.assertFault(response, 400, 'badRequest')
File "/home/devel/synnefo/../synnefo/api/tests.py", line 407, in assertFault
self.assertEqual(response.status_code, status_code)
AssertionError: 404 != 400

----------------------------------------------------------------------
Ran 38 tests in 5.110s

FAILED (failures=5, errors=4)
Destroying test database 'default'...

#2 Updated by Vangelis Koukis over 13 years ago

  • Status changed from Assigned to Closed

Αυτό διορθώθηκε στο 7317d130 στο api-current branch, τα tests έκαναν υποθέσεις που δεν έπρεπε για το πώς η βάση αποδίδει τιμές id στα instances του VirtualMachine. Κλείνει.

Also available in: Atom PDF