예제 #1
0
    def run_schema_and_assert(self, include, exclude, expected_tests):
        self.run_sql_file("seed.sql")
        self.run_dbt(["deps"])
        results = self.run_dbt(['run', '--exclude', 'never_selected'])
        self.assertEqual(len(results), 9)

        args = FakeArgs()
        args.models = include
        args.exclude = exclude

        test_task = TestTask(args, self.config)
        test_results = test_task.run()

        ran_tests = sorted([test.node.name for test in test_results])
        expected_sorted = sorted(expected_tests)

        self.assertEqual(ran_tests, expected_sorted)
    def run_schema_and_assert(self, include, exclude, expected_tests):
        self.run_sql_file("test/integration/007_graph_selection_tests/seed.sql")
        self.run_dbt(["deps"])
        results = self.run_dbt(['run', '--exclude', 'never_selected'])
        self.assertEqual(len(results), 9)

        args = FakeArgs()
        args.models = include
        args.exclude = exclude

        test_task = TestTask(args, self.config)
        test_results = test_task.run()

        ran_tests = sorted([test.node.get('name') for test in test_results])
        expected_sorted = sorted(expected_tests)

        self.assertEqual(ran_tests, expected_sorted)
    def run_schema_and_assert(self, include, exclude, expected_tests):
        self.run_sql_file(
            "test/integration/007_graph_selection_tests/seed.sql")
        self.run_dbt(["deps"])
        results = self.run_dbt()
        self.assertEqual(len(results), 7)

        args = FakeArgs()
        args.models = include
        args.exclude = exclude

        test_task = TestTask(args, self.config)
        test_results = test_task.run()

        ran_tests = sorted([test.node.get('name') for test in test_results])
        expected_sorted = sorted(expected_tests)

        self.assertEqual(ran_tests, expected_sorted)
예제 #4
0
    def run_schema_and_assert(self, include, exclude, expected_tests):
        self.use_profile('postgres')

        self.run_sql_file(
            "test/integration/007_graph_selection_tests/seed.sql")
        self.run_dbt(["deps"])
        self.run_dbt()

        args = FakeArgs()
        args.models = include
        args.exclude = exclude

        test_task = TestTask(args, self.project)
        test_results = test_task.run()

        ran_tests = sorted([test.model.name for test in test_results])
        expected_sorted = sorted(expected_tests)

        self.assertEqual(ran_tests, expected_sorted)
    def run_schema_and_assert(self, include, exclude, expected_tests):
        self.use_profile('postgres')
        self.use_default_project()
        self.project = read_project('dbt_project.yml')

        self.run_sql_file(
            "test/integration/007_graph_selection_tests/seed.sql")
        self.run_dbt(["deps"])
        results = self.run_dbt()
        self.assertEqual(len(results), 5)

        args = FakeArgs()
        args.models = include
        args.exclude = exclude

        test_task = TestTask(args, self.project)
        test_results = test_task.run()

        print(test_results)

        ran_tests = sorted([test.node.get('name') for test in test_results])
        expected_sorted = sorted(expected_tests)

        self.assertEqual(ran_tests, expected_sorted)