Skip to content

Task does nothing with invalid unit tests #7

@VenoMpie

Description

@VenoMpie

The VSTS task doesn't fail when there are invalid unit tests.
When running the command coverage run -m xmlrunner discover -s . -p test_*.py manually, coverage outputs the failed xml, etc. but the task doesn't output anything to console on this step and appears as if everything is fine while it's not. I see in the code that it's set to silent so I'm assuming this is intended behavior? Can't there be an option passed in to allow failing the task whenever tests are not passing. I don't want the build process to even continue when there are failures.

coverage run -m xmlrunner discover -s . -p test_*.py output

FAIL [0.000s]: test_test (tests.misc.test_fail.TestUnitTestDiscovery)

Traceback (most recent call last):
File "C:\agent_work\6\s\src\tests\misc\test_fail.py", line 6, in test_test
self.assertTrue(False)
AssertionError: False is not true

Runner Code

// Execute the unit tests
let unittestTool = tl.tool(coverageToolPath).arg(['run', '-m', 'xmlrunner', 'discover', '-s', '.', '-p', testFilePattern]);
unittestTool.execSync(toolRunOptions);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions