Skip to content

Commit

Permalink
Split tests apart
Browse files Browse the repository at this point in the history
  • Loading branch information
kbattocchi committed Aug 6, 2021
1 parent f0aa066 commit 74596e1
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
35 changes: 31 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ jobs:
parameters:
package: '-e .[tf,plt]'
job:
job: Tests_no_dml
job: Tests_main
dependsOn: 'EvalChanges'
condition: eq(dependencies.EvalChanges.outputs['output.testCode'], 'True')
displayName: 'Run tests (non-DML)'
displayName: 'Run tests (main)'
steps:
- script: 'pip install pytest-runner && python setup.py pytest'
displayName: 'Unit tests'
env:
PYTEST_ADDOPTS: '-m "not (notebook or automl or dml)"'
PYTEST_ADDOPTS: '-m "not (notebook or automl or dml or causal)"'
COVERAGE_PROCESS_START: 'setup.cfg'
- task: PublishTestResults@2
displayName: 'Publish Test Results **/test-results.xml'
Expand All @@ -196,7 +196,7 @@ jobs:
- script: 'pip install pytest-runner && python setup.py pytest'
displayName: 'Unit tests'
env:
PYTEST_ADDOPTS: '-m "dml and (not (notebook or automl))"'
PYTEST_ADDOPTS: '-m "dml"'
COVERAGE_PROCESS_START: 'setup.cfg'
- task: PublishTestResults@2
displayName: 'Publish Test Results **/test-results.xml'
Expand All @@ -210,3 +210,30 @@ jobs:
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'

- template: azure-pipelines-steps.yml
parameters:
package: '-e .[tf,plt]'
job:
job: Tests_causal
dependsOn: 'EvalChanges'
condition: eq(dependencies.EvalChanges.outputs['output.testCode'], 'True')
displayName: 'Run tests (Causal)'
steps:
- script: 'pip install pytest-runner && python setup.py pytest'
displayName: 'Unit tests'
env:
PYTEST_ADDOPTS: '-m "causal"'
COVERAGE_PROCESS_START: 'setup.cfg'
- task: PublishTestResults@2
displayName: 'Publish Test Results **/test-results.xml'
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Python $(python.version), image $(imageName)'
condition: succeededOrFailed()

- task: PublishCodeCoverageResults@1
displayName: 'Publish Code Coverage Results'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
2 changes: 2 additions & 0 deletions econml/tests/test_causal_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from numpy.core.fromnumeric import squeeze
import pandas as pd
from contextlib import ExitStack
import pytest
from econml.solutions.causal_analysis import CausalAnalysis
from econml.solutions.causal_analysis._causal_analysis import _CausalInsightsConstants

Expand All @@ -14,6 +15,7 @@ def assert_less_close(arr1, arr2):
assert np.all(np.logical_or(arr1 <= arr2, np.isclose(arr1, arr2)))


@pytest.mark.causal
class TestCausalAnalysis(unittest.TestCase):

def test_basic_array(self):
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ markers = [
"slow",
"notebook",
"automl",
"dml"
"dml",
"causal"
]

0 comments on commit 74596e1

Please sign in to comment.