Ejemplo n.º 1
0
    def wasm_test_plan(self):
        """
        The materialized logs:
        [
          itopic[0]._script_a_output_,
          itopic[1]._script_a_output_,
          itopic[2]._script_a_output_,
          itopic[0]._script_b_output_,
          itopic[1]._script_b_output_,
          itopic[2]._script_b_output_,
          itopic[0]._script_c_output_,
          itopic[1]._script_c_output_,
          itopic[2]._script_c_output_,
        ]
        Should exist by tests end and be identical to their respective input logs.

        This differs from the above because every script is writing to non unique
        output topics. Therefore this tests the output topic mutex within the
        script context.
        """
        opts = ["output_topic_a", "output_topic_b", "output_topic_c"]
        return [
            WasmScript(inputs=self.wasm_test_input(),
                       outputs=opts,
                       script=WasmTemplateRepository.IDENTITY_TRANSFORM),
            WasmScript(inputs=self.wasm_test_input(),
                       outputs=opts,
                       script=WasmTemplateRepository.IDENTITY_TRANSFORM),
            WasmScript(inputs=self.wasm_test_input(),
                       outputs=opts,
                       script=WasmTemplateRepository.IDENTITY_TRANSFORM)
        ]
Ejemplo n.º 2
0
 def wasm_test_plan(self):
     """
     The materialized logs:
     [
       itopic[0]._script_a_output_,
       itopic[1]._script_a_output_,
       itopic[2]._script_a_output_,
       itopic[0]._script_b_output_,
       itopic[1]._script_b_output_,
       itopic[2]._script_b_output_,
       itopic[0]._script_c_output_,
       itopic[1]._script_c_output_,
       itopic[2]._script_c_output_,
     ]
     Should exist by tests end and be identical to their respective input logs
     """
     return [
         WasmScript(inputs=self.wasm_test_input(),
                    outputs=['script_a_output'],
                    script=WasmTemplateRepository.IDENTITY_TRANSFORM),
         WasmScript(inputs=self.wasm_test_input(),
                    outputs=['script_b_output'],
                    script=WasmTemplateRepository.IDENTITY_TRANSFORM),
         WasmScript(inputs=self.wasm_test_input(),
                    outputs=['script_c_output'],
                    script=WasmTemplateRepository.IDENTITY_TRANSFORM)
     ]
Ejemplo n.º 3
0
    def _deploy_identity_copro(self, inputs, outputs):
        script = WasmScript(inputs=inputs,
                            outputs=outputs,
                            script=WasmTemplateRepository.IDENTITY_TRANSFORM)

        self._build_tool.build_test_artifacts(script)

        self._rpk_tool.wasm_deploy(
            script.get_artifact(self._build_tool.work_dir), script.name,
            "ducktape")
 def wasm_test_plan(self):
     return [
         WasmScript(inputs=self.wasm_test_input(),
                    outputs=["aaa"],
                    script=WasmTemplateRepository.IDENTITY_TRANSFORM),
         WasmScript(inputs=self.wasm_test_input(),
                    outputs=["bbb"],
                    script=WasmTemplateRepository.IDENTITY_TRANSFORM),
         WasmScript(inputs=self.wasm_test_input(),
                    outputs=["ccc"],
                    script=WasmTemplateRepository.IDENTITY_TRANSFORM)
     ]
 def wasm_test_plan(self):
     return [
         WasmScript(
             inputs=self.wasm_test_input(),
             outputs=["output_topic_a", "output_topic_b", "output_topic_c"],
             script=WasmTemplateRepository.IDENTITY_TRANSFORM),
         WasmScript(
             inputs=self.wasm_test_input(),
             outputs=["output_topic_a", "output_topic_b", "output_topic_c"],
             script=WasmTemplateRepository.IDENTITY_TRANSFORM),
         WasmScript(
             inputs=self.wasm_test_input(),
             outputs=["output_topic_a", "output_topic_b", "output_topic_c"],
             script=WasmTemplateRepository.IDENTITY_TRANSFORM)
     ]
Ejemplo n.º 6
0
 def __init__(self, test_context, extra_rp_conf=None):
     super(WasmFilterTest, self).__init__(test_context,
                                          extra_rp_conf=extra_rp_conf or {})
     self._num_records = 32
     self._expected_record_cnt = self._num_records / 2
     self._output_topic = "default_output"
     self._script = WasmScript(
         inputs=[x.name for x in self.topics],
         outputs=[self._output_topic],
         script=WasmTemplateRepository.FILTER_TRANSFORM,
     )
Ejemplo n.º 7
0
 def wasm_test_plan(self):
     """
     List of scripts to deploy, built from the results of wasm_test_outputs().
     By default inputs to all scripts will be self.input_topics()
     """
     itopics = self.input_topics()
     return [
         WasmScript(inputs=itopics,
                    outputs=opts,
                    script=WasmTemplateRepository.IDENTITY_TRANSFORM)
         for opts in self.wasm_test_outputs()
     ]
Ejemplo n.º 8
0
 def wasm_test_plan(self):
     """
     The materialized log:
     [
       itopic._script_a_output_,
     ]
     Should exist by tests end and be identical to its respective input log
     """
     return [
         WasmScript(inputs=self.wasm_test_input(),
                    outputs=["script_a_output"],
                    script=WasmTemplateRepository.IDENTITY_TRANSFORM)
     ]
Ejemplo n.º 9
0
 def wasm_test_plan(self):
     """
     The materialized logs:
     [
       itopic._script_a_output_,
       itopic._script_b_output_,
       itopic._script_c_output_,
     ]
     """
     return [
         WasmScript(inputs=self.wasm_test_input(),
                    outputs=["sou_a", "sou_b", "sou_c"],
                    script=WasmTemplateRepository.IDENTITY_TRANSFORM)
     ]
 def wasm_test_plan(self):
     return [
         WasmScript(inputs=self.wasm_test_input(),
                    outputs=["first_topic", "second_topic", "third_topic"],
                    script=WasmTemplateRepository.IDENTITY_TRANSFORM)
     ]