def _generate_fuzzer_tasks(self, version_configs, is_sharded):
        dt = DisplayTaskDefinition(self.task)

        for version_config in version_configs:
            fuzzer_config = generate_resmoke.ConfigOptions(self.options.config)
            fuzzer_config = self._get_fuzzer_options(version_config, is_sharded)
            gen_fuzzer.generate_evg_tasks(fuzzer_config, self.evg_config,
                                          task_name_suffix=version_config, display_task=dt)
        dt.execution_task(f"{fuzzer_config.name}_gen")
        self.evg_config.variant(self.options.variant).display_task(dt)
        return self.evg_config
예제 #2
0
    def test_evg_config_is_created_without_multiversion(self):
        evg_config = Configuration()
        options = self._create_options_mock()

        config = gft.generate_evg_tasks(options, evg_config).to_map()

        self.assertEqual(options.num_tasks, len(config["tasks"]))

        self.assertEqual("setup jstestfuzz",
                         config["tasks"][0]["commands"][1]["func"])

        command1 = config["tasks"][0]["commands"][2]
        self.assertIn(str(options.num_files),
                      command1["vars"]["jstestfuzz_vars"])
        self.assertIn(options.npm_command, command1["vars"]["npm_command"])
        self.assertEqual("run jstestfuzz", command1["func"])

        buildvariant = config["buildvariants"][0]
        self.assertEqual(options.variant, buildvariant["name"])
        self.assertEqual(options.num_tasks, len(buildvariant["tasks"]))
        self.assertEqual(
            options.num_tasks + 1,
            len(buildvariant["display_tasks"][0]["execution_tasks"]))
        self.assertEqual(options.name,
                         buildvariant["display_tasks"][0]["name"])
        self.assertIn(options.name + "_gen",
                      buildvariant["display_tasks"][0]["execution_tasks"])
예제 #3
0
    def _generate_fuzzer_tasks(self, config):
        suite_file = self.options.suite + ".yml"
        # Update the jstestfuzz yml suite with the proper multiversion configurations.
        source_config = generate_resmoke.read_yaml(TEST_SUITE_DIR, suite_file)
        config.update_yaml(source_config)
        updated_yml = generate_resmoke.generate_resmoke_suite_config(source_config, suite_file)
        file_dict = {f"{self.options.suite}.yml": updated_yml}
        dt = DisplayTaskDefinition(self.task)

        for version_config in config.version_configs:
            fuzzer_config = self._get_fuzzer_options(version_config, suite_file)
            gen_fuzzer.generate_evg_tasks(fuzzer_config, self.evg_config,
                                          task_name_suffix=version_config, display_task=dt)
        generate_resmoke.write_file_dict(CONFIG_DIR, file_dict)
        dt.execution_task(f"{fuzzer_config.name}_gen")
        self.evg_config.variant(self.options.variant).display_task(dt)
        return self.evg_config
예제 #4
0
    def test_evg_config_is_created_with_multiversion(self):
        evg_config = Configuration()
        options = self._create_options_mock()
        options.use_multiversion = "/data/multiversion"

        config = gft.generate_evg_tasks(options, evg_config).to_map()

        self.assertEqual("do multiversion setup",
                         config["tasks"][0]["commands"][1]["func"])
        self.assertEqual(
            "/data/multiversion",
            config["tasks"][0]["commands"][4]["vars"]["task_path_suffix"])