示例#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!")