Giter Site home page Giter Site logo

destral's Introduction

Destral testing library

A library to do tests with our OpenERP Server (v5)

https://travis-ci.org/gisce/destral.svg?branch=master

Note

The API is not stable, and can be changed.

Code as if the next guy to maintain your code is a homicidal maniac who knows where you live.

—Kathy Sierra and Bert Bates

destral's People

Contributors

a-orellana avatar amatmv avatar eberloso avatar ecarreras avatar francescpuig7 avatar giscegit avatar guillejb avatar lowks avatar mameijeiras avatar mroig avatar oriolpiera avatar polsala avatar rchamorro avatar sim6 avatar tinogis avatar vokimon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

destral's Issues

approach use a new db for each module

When tests of different modules are passed, the db is reused for each one, sometimes it can lead to problems in the tests because another module has extended or modified the scheme of some tables

test_translate_modules doesn't work

Please could you take a look at https://drone.gisce.net/gisce/erp/5020

Especially to:

2017-07-03 09:15:29,584:INFO:destral.utils.compare_pofiles:Could not get po/pot file: /drone/src/github.com/gisce/erp/server/bin/addons/giscedata_perfils/i18n/[.po

AssertionError: There are -1 missing strings in the PO file of the module giscedata_perfils

But maybe is a testing suite configuration problem.

Allow multiprocess on destral execute

Execute destral with multiprocess on 1 process:

  1. Create a multiprocessing pool
  2. Queue destral for each affected module
  3. Run the queued processes with multiprocessing
  • On Circle-CI only 1 process, so the output won't be messed up
  • Without attending Output, we could multi-process it
  • The return value of the multiprocesses would be the JUnit so we can get all the data from those runs

PROS:

  • No python imports on vars would be affected on multi-module tests
  • No DB side-effects on multi-module tests (each run would have a new DB)

It takes a lot of time to install tested modules when, may be, it is not required.

I am not sure if this is possible, but each time a test run starts it installs the module and all their dependencies, when may be it is not required when the database already exists. This is takes a lot of time and makes unit testing tedious.

I tried commenting line 51 (self.openerp.install_module(self.config['module'])) and the speed improvement is huge!

I propose two possible solutions that:

  • Be more smart installing the module only when it is necessary (I am not really sure this is really possible).
  • Add an environment variable or paramter to disable installation of the module showing a warning so developer knows it is disabled.

Generated POT in tests contains strings from other modules

When testing the module "base_extended", the .pot file generated in the test contains strings from module "base" and it should only contain strings from "base_extended"; like the .pot file generated from the ERP (Administration->Translations->Import/Export...).

Same with giscedata_ot_facturacio and giscedata_ot

Check reports

If we have demo data check all the reports defined in the module with that demo data

Multi-module test crashes

Bug Found

  • When you try to test multiple modules on the same execution, the Destral crashes after finish the first module test and start the next one.
  • The stack trace of the error is the following one:
    image

Allow when creating a Transaction() use PatchedCursor

For now if we want to patch the creation of new cursors inside a test we have to do:

with Transaction().start(self.database) as txn:
    with PatchNewCursors():
        ...

Maybe we can add the possibillity in creation a new Transaction to define to use PatchedCursors as

with Transaction(same_cursor=True).start(self.database) as txn:
    ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.