GithubHelp home page GithubHelp logo

Comments (10)

jvegreg avatar jvegreg commented on July 24, 2024 2

And maybe open a specific one to improve derivation testing? See shorturl.at/cJKZ3

from esmvalcore.

bouweandela avatar bouweandela commented on July 24, 2024 1

Regarding testing: please avoid using sys.exit() anywhere in your code, this makes the code untestable. This is because if sys.exit() is called because a single test fails, the test execution python program will exit and no other tests will be performed and no report will be generated. Instead raise an informative exception. I have added code to main.py (pull request #91) which will log any exception that is raised and goes uncaught and after that calls sys.exit(1) to keep the current behaviour.

from esmvalcore.

valeriupredoi avatar valeriupredoi commented on July 24, 2024 1

current testing average for ESMValCore is about 80-85% -> not bad! There's a couple PR's with more testing, I reckon it's safe to close this? 🍺

from esmvalcore.

nielsdrost avatar nielsdrost commented on July 24, 2024

@jvegasbsc I cannot seem to run the tests with coverage. What is the intended usage of the run_tests.py script? running it from the esmvaltool root runs all the tests but without any coverage, running it inside the test folder gives me coverage but allmost all the tests fail. Am I missing something?

from esmvalcore.

nielsdrost avatar nielsdrost commented on July 24, 2024

Instead of trying to agree on the best testing framework, we use pytest to run everything, which in turn supports all the major testing frameworks.

Note that we should update the documentation

from esmvalcore.

bouweandela avatar bouweandela commented on July 24, 2024

I've started a branch for implementing tests: https://github.com/ESMValGroup/ESMValTool/tree/REFACTORING_tests

from esmvalcore.

mattiarighi avatar mattiarighi commented on July 24, 2024

@BenMGeo might be interested in this issue.

from esmvalcore.

nielsdrost avatar nielsdrost commented on July 24, 2024

We should also add unit tests covering #146 and #148

from esmvalcore.

bouweandela avatar bouweandela commented on July 24, 2024

Related issue that addresses part of this task https://github.com/ESMValGroup/ESMValTool/issues/228.

from esmvalcore.

valeriupredoi avatar valeriupredoi commented on July 24, 2024

so bad stuff, apart from derive modules and main (I have a PR that ups the testing cov for main to 86%):

esmvalcore/cmor/_fixes/cmip5/bcc_csm1_1.py           25     19    24%
esmvalcore/cmor/_fixes/cmip5/bcc_csm1_1_m.py         26     19    27%
esmvalcore/cmor/_fixes/cmip5/hadgem2_cc.py           19     12    37%
esmvalcore/cmor/_fixes/cmip5/hadgem2_es.py           19     12    37%
esmvalcore/cmor/_fixes/cmip5/mri_cgcm3.py            11      4    64%
esmvalcore/cmor/_fixes/cmip6/cesm2.py                22      9    59%
esmvalcore/cmor/_fixes/cmip6/gfdl_cm4.py             21     12    43%
esmvalcore/cmor/_fixes/cmip6/mpi_esm1_2_hr.py        21     10    52%
esmvalcore/cmor/_fixes/obs4mips/ssmi.py              10      6    40%
esmvalcore/cmor/_fixes/obs4mips/ssmi_meris.py         7      2    71%
esmvalcore/preprocessor/_download.py                 45     37    18%
esmvalcore/preprocessor/_io.py                      196     54    72%
esmvalcore/utils/draft_release_notes.py              42     29    31%

everything else is above 75%

from esmvalcore.

Related Issues (20)

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.