예제 #1
0
파일: test.py 프로젝트: yilab/dbt
    def run(self):
        self.compile()

        runner = RunManager(
            self.project, self.project['target-path'], self.args
        )

        include = self.args.models
        exclude = self.args.exclude

        if (self.args.data and self.args.schema) or \
           (not self.args.data and not self.args.schema):
            res = runner.run_tests(include, exclude,
                                   test_schemas=True, test_data=True)
        elif self.args.data:
            res = runner.run_tests(include, exclude,
                                   test_schemas=False, test_data=True)
        elif self.args.schema:
            res = runner.run_tests(include, exclude,
                                   test_schemas=True, test_data=False)
        else:
            raise RuntimeError("unexpected")

        logger.info("Done!")
        return res
예제 #2
0
    def run(self):
        self.compile()
        runner = RunManager(self.project, self.project['target-path'], 'build',
                            self.args.threads)

        if (self.args.data and self.args.schema) or (not self.args.data
                                                     and not self.args.schema):
            res = runner.run_tests(test_schemas=True, test_data=True)
        elif self.args.data:
            res = runner.run_tests(test_schemas=False, test_data=True)
        elif self.args.schema:
            res = runner.run_tests(test_schemas=True, test_data=False)
        else:
            raise RuntimeError("unexpected")

        print("Done!")
        return res
예제 #3
0
파일: test.py 프로젝트: igrayson/dbt
    def run(self):
        runner = RunManager(self.project, self.project['target-path'],
                            self.args)

        include = self.args.models
        exclude = self.args.exclude

        test_types = [self.args.data, self.args.schema]

        if all(test_types) or not any(test_types):
            results = runner.run_tests(include, exclude, set())
        elif self.args.data:
            results = runner.run_tests(include, exclude, {'data'})
        elif self.args.schema:
            results = runner.run_tests(include, exclude, {'schema'})
        else:
            raise RuntimeError("unexpected")

        logger.info(dbt.utils.get_run_status_line(results))

        return results
예제 #4
0
파일: test.py 프로젝트: bellhops/dbt
    def run(self):
        runner = RunManager(self.project, self.project['target-path'],
                            self.args)

        include = self.args.models
        exclude = self.args.exclude

        test_types = [self.args.data, self.args.schema]

        if all(test_types) or not any(test_types):
            results = runner.run_tests(include, exclude, set())
        elif self.args.data:
            results = runner.run_tests(include, exclude, {'data'})
        elif self.args.schema:
            results = runner.run_tests(include, exclude, {'schema'})
        else:
            raise RuntimeError("unexpected")

        dbt.ui.printer.print_run_end_messages(results)

        return results
예제 #5
0
파일: test.py 프로젝트: menetrier/dbt
    def run(self):
        self.compile()
        runner = RunManager(self.project, self.project['target-path'], 'build')
        runner.run_tests()

        print("Done!")