@platforma-sdk/workflow-tengo 2.8.0 → 2.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/tengo/lib/assets.lib.tengo +76 -82
  2. package/dist/tengo/lib/constants.lib.tengo +28 -31
  3. package/dist/tengo/lib/exec.R.internal.lib.tengo +14 -14
  4. package/dist/tengo/lib/exec.R.lib.tengo +158 -167
  5. package/dist/tengo/lib/exec.internal.lib.tengo +222 -234
  6. package/dist/tengo/lib/exec.lib.tengo +647 -714
  7. package/dist/tengo/lib/exec.package.lib.tengo +229 -238
  8. package/dist/tengo/lib/exec.python.internal.lib.tengo +5 -6
  9. package/dist/tengo/lib/exec.python.lib.tengo +138 -146
  10. package/dist/tengo/lib/exec.runcmd.lib.tengo +234 -253
  11. package/dist/tengo/lib/exec.runenv.lib.tengo +88 -92
  12. package/dist/tengo/lib/exec.stream.lib.tengo +36 -40
  13. package/dist/tengo/lib/file.internal.lib.tengo +70 -77
  14. package/dist/tengo/lib/file.lib.tengo +54 -57
  15. package/dist/tengo/lib/ll.lib.tengo +217 -241
  16. package/dist/tengo/lib/maps.lib.tengo +98 -106
  17. package/dist/tengo/lib/objects.lib.tengo +11 -13
  18. package/dist/tengo/lib/oop.lib.tengo +16 -19
  19. package/dist/tengo/lib/path.lib.tengo +116 -125
  20. package/dist/tengo/lib/pframes.constants.lib.tengo +25 -28
  21. package/dist/tengo/lib/pframes.export-pcolumn.lib.tengo +28 -33
  22. package/dist/tengo/lib/pframes.lib.tengo +38 -43
  23. package/dist/tengo/lib/pframes.ll.lib.tengo +70 -73
  24. package/dist/tengo/lib/pframes.pcolumn.lib.tengo +45 -51
  25. package/dist/tengo/lib/pframes.spec.lib.tengo +70 -96
  26. package/dist/tengo/lib/pframes.util.lib.tengo +154 -289
  27. package/dist/tengo/lib/pframes.xsv.lib.tengo +260 -273
  28. package/dist/tengo/lib/render.lib.tengo +65 -76
  29. package/dist/tengo/lib/sets.lib.tengo +61 -68
  30. package/dist/tengo/lib/slices.lib.tengo +169 -180
  31. package/dist/tengo/lib/smart.lib.tengo +956 -1069
  32. package/dist/tengo/lib/test.lib.tengo +129 -161
  33. package/dist/tengo/lib/tpl.lib.tengo +448 -516
  34. package/dist/tengo/lib/tpl.state-await.lib.tengo +226 -241
  35. package/dist/tengo/lib/tpl.util.lib.tengo +4 -9
  36. package/dist/tengo/lib/validation.lib.tengo +334 -379
  37. package/dist/tengo/lib/workdir.lib.tengo +309 -332
  38. package/dist/tengo/lib/workdir.proc.lib.tengo +126 -144
  39. package/dist/tengo/lib/workdir.save.lib.tengo +113 -130
  40. package/dist/tengo/lib/workflow.bobject.lib.tengo +21 -26
  41. package/dist/tengo/lib/workflow.bquery.lib.tengo +140 -166
  42. package/dist/tengo/lib/workflow.constants.lib.tengo +1 -2
  43. package/dist/tengo/lib/workflow.context.lib.tengo +27 -32
  44. package/dist/tengo/lib/workflow.lib.tengo +167 -207
  45. package/dist/tengo/tpl/exec.R.create-renv.plj.gz +0 -0
  46. package/dist/tengo/tpl/exec.exec.plj.gz +0 -0
  47. package/dist/tengo/tpl/exec.python.create-venv.plj.gz +0 -0
  48. package/dist/tengo/tpl/exec.python.install-deps.plj.gz +0 -0
  49. package/dist/tengo/tpl/pframes.aggregate.plj.gz +0 -0
  50. package/dist/tengo/tpl/pframes.export-multiple-pcolumns.plj.gz +0 -0
  51. package/dist/tengo/tpl/pframes.export-pframe.plj.gz +0 -0
  52. package/dist/tengo/tpl/pframes.export-single-pcolumn.plj.gz +0 -0
  53. package/dist/tengo/tpl/pframes.import-dir.plj.gz +0 -0
  54. package/dist/tengo/tpl/pframes.map-pframe.plj.gz +0 -0
  55. package/dist/tengo/tpl/pframes.xsv-export-pframe.plj.gz +0 -0
  56. package/dist/tengo/tpl/pframes.xsv-import-map.plj.gz +0 -0
  57. package/dist/tengo/tpl/workdir.save.plj.gz +0 -0
  58. package/dist/tengo/tpl/workflow.build-ctx.plj.gz +0 -0
  59. package/package.json +5 -5
@@ -1,204 +1,172 @@
1
- /*
2
- * Library for tengo unit tests.
3
- * Contains collection of helpers, that make tengo unit tests more compact, easier for reading and writing.
4
- *
5
- * WARNING: It is designed to be imported ONLY in *.test.tengo files.
6
- * As it works ONLY in tengo unit tests context, it will break any workflow if imported
7
- * in .lib.tengo or .tpl.tengo file.
8
- */
1
+
2
+
3
+
4
+
5
+
6
+
7
+
9
8
 
10
9
  test := import("test")
11
10
 
12
- //
13
- // Basic re-export from "test" builtin library with some conveniences
14
- //
15
11
 
16
- /**
17
- * Skip the test writing given message to the console log.
18
- *
19
- * @param args: []any - message to be written.
20
- * Each argument is converted to string with its default formatter.
21
- */
12
+
13
+
14
+
15
+
16
+
22
17
  skip := func(...args) {
23
- test.skip(args...)
18
+ test.skip(args...)
24
19
  }
25
20
 
26
- /**
27
- * Formatted version of skip(). skipf(msg, ...args) == skip(format(msg, args...))
28
- *
29
- * @param msg: string - message with formatting directives.
30
- * @param args: []any - arguments for directives in <msg>.
31
- */
21
+
22
+
23
+
24
+
25
+
32
26
  skipf := func(msg, ...args) {
33
- skip(format(msg, args...))
27
+ skip(format(msg, args...))
34
28
  }
35
29
 
36
- /**
37
- * Fail the test in place. Interrupts execution of single test and prints a
38
- * failure message to the console log.
39
- *
40
- * @param args: []any - message to be written.
41
- * Each argument is converted to string with its default formatter.
42
- */
30
+
31
+
32
+
33
+
34
+
35
+
43
36
  fail := func(...args) {
44
- test.fail(args...)
37
+ test.fail(args...)
45
38
  }
46
39
 
47
- /**
48
- * Formatted version of fail(). failf(msg, ...args) == fail(format(msg, args...))
49
- *
50
- * @param msg: string - message with formatting directives.
51
- * @param args: []any - arguments for directives in <msg>.
52
- */
40
+
41
+
42
+
43
+
44
+
53
45
  failf := func(msg, ...args) {
54
- fail(format(msg, args...))
46
+ fail(format(msg, args...))
55
47
  }
56
48
 
57
- /**
58
- * Write message to console log.
59
- *
60
- * @param args: []any - message to be written.
61
- * Each argument is converted to string with its default formatter.
62
- */
49
+
50
+
51
+
52
+
53
+
63
54
  log := func(...args) {
64
- test.log(args...)
55
+ test.log(args...)
65
56
  }
66
57
 
67
- /**
68
- * Formatted version of log(). logf(msg, ...args) == log(format(msg, args...))
69
- *
70
- * @param msg: string - message with formatting directives.
71
- * @param args: []any - arguments for directives in <msg>.
72
- */
58
+
59
+
60
+
61
+
62
+
73
63
  logf := func(msg, ...args) {
74
- test.log(format(msg, args...))
75
- }
76
-
77
- /**
78
- * Mark test as executed for tengo testing engine.
79
- *
80
- * Regular tengo file with tests contains bunch of fuctions starting with 'Test' prefix, like `TestMyFunction := func() { ... }`.
81
- * You DO NOT need to call this Done() method if you have file with Test* functions.
82
- *
83
- * For some rare cases, you may want to define your own custom testing script, that will call functions on its own instead
84
- * of using the standard test functions naming. In this case, testing engine needs to know the difference between "nothing was called at all"
85
- * and "everything was done well". This is what this method for.
86
- *
87
- * You don't need it in 99.9% of cases.
88
- *
89
- * This method does not interrupt test execution and is intended for use in custom test scripts
90
- * without declared test functions.
91
- */
64
+ test.log(format(msg, args...))
65
+ }
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
92
81
  done := func() {
93
- test.done()
82
+ test.done()
94
83
  }
95
84
 
96
- //
97
- // Boolean assertions
98
- //
99
85
 
100
- /**
101
- * Require <condition> to be true, failing test when not.
102
- *
103
- * @param condition: bool
104
- * @param msg: []any - message to be printed on check failure
105
- */
86
+
87
+
88
+
89
+
90
+
106
91
  isTrue := func(condition, ...msg) {
107
- if !condition {
108
- test.fail("<condition> != 'true': ", msg...)
109
- }
110
- }
111
-
112
- /**
113
- * Formatted version of isTrue(). isTruef(condition, msg, ...args) == isTrue(condition, format(msg, args...))
114
- *
115
- * @param condition: bool
116
- * @param msg: string - message with formatting directives to be printed on check failure
117
- * @param args: []any - arguments for formatting directives in <msg>
118
- */
92
+ if !condition {
93
+ test.fail("<condition> != 'true': ", msg...)
94
+ }
95
+ }
96
+
97
+
98
+
99
+
100
+
101
+
102
+
119
103
  isTruef := func(condition, msg, ...args) {
120
- isTrue(condition, format(msg, args...))
104
+ isTrue(condition, format(msg, args...))
121
105
  }
122
106
 
123
- /**
124
- * Require <condition> to be false, failing test when not.
125
- *
126
- * @param condition: bool
127
- * @param args: []any - message to be printed on check failure
128
- */
107
+
108
+
109
+
110
+
111
+
129
112
  isFalse := func(condition, ...args) {
130
- if condition {
131
- test.fail("<condition> != 'false'", args...)
132
- }
133
- }
134
-
135
- /**
136
- * Formatted version of isFalse(). isFalsef(condition, msg, ..args) == isFalse(condition, format(msg, args...))
137
- *
138
- * @param condition: bool
139
- * @param msg: string - message with formatting directives to be printed on check failure
140
- * @param args: []any - arguments for formatting directives in <msg>
141
- */
113
+ if condition {
114
+ test.fail("<condition> != 'false'", args...)
115
+ }
116
+ }
117
+
118
+
119
+
120
+
121
+
122
+
123
+
142
124
  isFalsef := func(condition, msg, ...args) {
143
- isFalse(condition, format(msg, args...))
125
+ isFalse(condition, format(msg, args...))
144
126
  }
145
127
 
146
- //
147
- // Equality assertions
148
- //
149
128
 
150
- /**
151
- * Fails test when <expect> != <value>
152
- *
153
- * @param expect: any - expected value for the equality check
154
- * @param value: any - the value to be checked
155
- * @param args: []any - the message to be printed on check failure
156
- */
129
+
130
+
131
+
132
+
133
+
134
+
157
135
  isEqual := func(expect, value, ...args) {
158
- if expect == value {
159
- return
160
- }
136
+ if expect == value {
137
+ return
138
+ }
161
139
 
162
- msg := format("%q != %q (expect: %#v, got %#v)", expect, value, expect, value)
140
+ msg := format("%q != %q (expect: %#v, got %#v)", expect, value, expect, value)
163
141
 
164
- fail(msg, args...)
142
+ fail(msg, args...)
165
143
  }
166
144
 
167
- /**
168
- * Formatted version of isEqual(). isEqualf(expect, value, msg, ..args) == isEqual(expect, value, format(msg, args...))
169
- *
170
- * @param expect: any - expected value for the equality check
171
- * @param value: any - the value to be checked
172
- * @param msg: string - message with formatting directives to be printed on check failure
173
- * @param args: []any - arguments for formatting directives in <msg>
174
- */
145
+
146
+
147
+
148
+
149
+
150
+
151
+
175
152
  isEqualf := func(expect, value, msg, ...args) {
176
- isEqual(expect, value, format(msg, args...))
153
+ isEqual(expect, value, format(msg, args...))
177
154
  }
178
155
 
179
156
  export {
180
- //
181
- // Builtin 'test' module method wrappers
182
- //
183
- done : done,
184
- skip : skip,
185
- skipf : skipf,
186
- fail : fail,
187
- failf : failf,
188
- log : log,
189
- logf : logf,
190
-
191
- //
192
- // Boolean assertions
193
- //
194
- isTrue : isTrue,
195
- isTruef : isTruef,
196
- isFalse : isFalse,
197
- isFalsef : isFalsef,
198
-
199
- //
200
- // Equality assertions
201
- //
202
- isEqual : isEqual,
203
- isEqualf : isEqualf
157
+ done : done,
158
+ skip : skip,
159
+ skipf : skipf,
160
+ fail : fail,
161
+ failf : failf,
162
+ log : log,
163
+ logf : logf,
164
+
165
+ isTrue : isTrue,
166
+ isTruef : isTruef,
167
+ isFalse : isFalse,
168
+ isFalsef : isFalsef,
169
+
170
+ isEqual : isEqual,
171
+ isEqualf : isEqualf
204
172
  }