Opened 10 years ago

Closed 6 years ago

Last modified 6 years ago

#1438 closed enhancement (obsolete)

add test suite

Reported by: sascha_silbe Owned by: sascha_silbe
Priority: Unspecified by Maintainer Milestone:
Component: Sugar Version: Git as of bugdate
Severity: Unspecified Keywords: r?
Cc: Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description

A test suite often catches programming mistakes and helps ensuring that a component works as intended. The attached patch has already helped me discover several bugs.

Tomeu wrote in #595 that testing isn't really tied to a particular release, so not setting milestone.

Please note that until #1342 is fixed, a single test suite failure is expected (and shows that it's working as designed).

Change History (8)

comment:1 Changed 10 years ago by sascha_silbe

  • Component changed from sugar to sugar-datastore
  • Keywords r? added
  • Status changed from new to accepted
  • Version changed from Unspecified to Git as of bugdate

comment:2 Changed 9 years ago by sascha_silbe

Latest version of test suite is in branch t/testsuite (managed with TopGit) inside my clone of sugar-datastore.

comment:3 Changed 9 years ago by alsroot

  • Keywords r! added; r? removed

I got these errors after applying #1437 and #1342

Doctest: basic_api.txt ... FAIL
ERROR
Run create() lots of times. ... ok (2.826s)
Run find() to list all entries lots of times. ... ok (1.163s)
Run get_filename() on all entries and verify content. ... ok (0.106s)
Run get_properties() on all entries and verify it. ... FAIL
Update the content of all existing entries ... ok (1.501s)
Verify test_update() has changed the content of all entries. ... ok (0.108s)
ERROR

======================================================================
ERROR: runTest (__main__.TestSuiteWrapper)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/sugar/src/git/datastore/tests/runalltests.py", line 120, in run
    self.tearDown()
  File "/home/sugar/src/git/datastore/tests/runalltests.py", line 138, in tearDown
    assert (not datastore.find({}, ['uid'], byte_arrays=True))
AssertionError

======================================================================
ERROR: runTest (__main__.TestSuiteWrapper)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/sugar/src/git/datastore/tests/runalltests.py", line 120, in run
    self.tearDown()
  File "/home/sugar/src/git/datastore/tests/runalltests.py", line 138, in tearDown
    assert (not datastore.find({}, ['uid'], byte_arrays=True))
AssertionError

======================================================================
FAIL: Doctest: basic_api.txt
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python2.6/doctest.py", line 2145, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for basic_api.txt
  File "/home/sugar/src/git/datastore/tests/basic_api.txt", line 0

----------------------------------------------------------------------
File "/home/sugar/src/git/datastore/tests/basic_api.txt", line 61, in basic_api.txt
Failed example:
    d
Expected:
    {dbus.String(u'title'): dbus.ByteArray('DS test object 2', variant_level=1), dbus.String(u'mime_type'): dbus.ByteArray('text/html', variant_level=1), dbus.String(u'activity'): dbus.ByteArray('org.sugarlabs.DataStoreTest3', variant_level=1)}
Got:
    {dbus.String(u'activity'): dbus.ByteArray('org.sugarlabs.DataStoreTest3', variant_level=1), dbus.String(u'mime_type'): dbus.ByteArray('text/html', variant_level=1), dbus.String(u'title'): dbus.ByteArray('DS test object 2', variant_level=1)}


======================================================================
FAIL: Run get_properties() on all entries and verify it.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/sugar/src/git/datastore/tests/test_massops.py", line 59, in test_get_properties
    assert (properties == self._create_properties)
AssertionError

----------------------------------------------------------------------
Ran 9 tests in 6.473s

FAILED (failures=2, errors=2)

Does test requires some preparation in environment or just make check?

comment:4 Changed 9 years ago by sascha_silbe

  • Keywords r? added; r! removed

Please try the current version in branch t/testsuite in my repo.
sugar-datastore requires sugar-toolkit at runtime, so you need to run the test suite via sugar-jhbuild:
../../sugar-jhbuild run make check

comment:5 Changed 9 years ago by erikos

  • Milestone changed from Unspecified by Release Team to 0.90

Moving that to 0.90 as discussed with Sascha on irc.

comment:6 Changed 6 years ago by dnarvaez

  • Component changed from sugar-datastore to Sugar

comment:7 Changed 6 years ago by dnarvaez

  • Resolution set to obsolete
  • Status changed from accepted to closed

comment:8 Changed 6 years ago by dnarvaez

  • Milestone 0.90 deleted

Milestone 0.90 deleted

Note: See TracTickets for help on using tickets.