Skip to content

Unable to test procedures #355

@jnasbyupgrade

Description

@jnasbyupgrade

Based on what pgTap functions are available, I thought that you could use all the function testing functions (ie, is_definer()) to test procedures. Turns out... not so much...

+not ok 1 - Function _task.task__run_for(text, int, task.task_options, boolean) should exist
+# Failed test 1: "Function _task.task__run_for(text, int, task.task_options, boolean) should exist"
+ok 2 - Function task.task__run_for(text, int, task.task_options, boolean) should be a procedure
+not ok 3 - Function _task.task__run_for(text, int, task.task_options, boolean) should be security definer
+# Failed test 3: "Function _task.task__run_for(text, int, task.task_options, boolean) should be security definer"
+#     (test result was NULL)
+not ok 4 - Function _task.task__run_for(text, int, task.task_options, boolean) should be VOLATILE
+# Failed test 4: "Function _task.task__run_for(text, int, task.task_options, boolean) should be VOLATILE"
+#     Function _task.task__run_for(text, int, task.task_options, boolean) does not exist
+not ok 5 - Function _task.task__run_for(text, int, task.task_options, boolean) should not be strict
+# Failed test 5: "Function _task.task__run_for(text, int, task.task_options, boolean) should not be strict"
+#     (test result was NULL)

The two possibilities that come to mind are:

  1. change the existing functions to recognize both functions and procedures
  2. create a duplicate set of functions for just procedures

I'm leaning towards 1 just to reduce the number of functions in the extension.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions