@voxgig/sdkgen 4.8.2 → 4.8.3
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.
- package/bin/voxgig-sdkgen +1 -1
- package/dist/action/doctor.d.ts +1 -0
- package/dist/action/doctor.js +50 -2
- package/dist/action/doctor.js.map +1 -1
- package/dist/helpers/naming.js +4 -2
- package/dist/helpers/naming.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/model/sdkgen.aon +21 -0
- package/package.json +1 -1
- package/project/.sdk/model/feature/secrets.aon +120 -18
- package/project/.sdk/model/target/c.aon +10 -0
- package/project/.sdk/model/target/clojure.aon +13 -0
- package/project/.sdk/model/target/cpp.aon +10 -0
- package/project/.sdk/model/target/csharp.aon +9 -0
- package/project/.sdk/model/target/dart.aon +10 -0
- package/project/.sdk/model/target/elixir.aon +9 -0
- package/project/.sdk/model/target/go.aon +13 -0
- package/project/.sdk/model/target/java.aon +9 -0
- package/project/.sdk/model/target/js.aon +7 -0
- package/project/.sdk/model/target/kotlin.aon +9 -0
- package/project/.sdk/model/target/lean.aon +17 -0
- package/project/.sdk/model/target/lua.aon +8 -0
- package/project/.sdk/model/target/ocaml.aon +9 -0
- package/project/.sdk/model/target/perl.aon +8 -0
- package/project/.sdk/model/target/php.aon +8 -0
- package/project/.sdk/model/target/py.aon +13 -0
- package/project/.sdk/model/target/rb.aon +8 -0
- package/project/.sdk/model/target/rust.aon +10 -0
- package/project/.sdk/model/target/scala.aon +21 -2
- package/project/.sdk/model/target/swift.aon +18 -0
- package/project/.sdk/model/target/ts.aon +13 -0
- package/project/.sdk/src/cmp/clojure/Package_clojure.ts +9 -2
- package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +3 -0
- package/project/.sdk/src/cmp/dart/Test_dart.ts +2 -0
- package/project/.sdk/src/cmp/elixir/Package_elixir.ts +4 -1
- package/project/.sdk/src/cmp/go/Config_go.ts +59 -2
- package/project/.sdk/src/cmp/go/Main_go.ts +8 -2
- package/project/.sdk/src/cmp/java/Test_java.ts +6 -5
- package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +6 -5
- package/project/.sdk/src/cmp/lean/Package_lean.ts +23 -0
- package/project/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +1 -0
- package/project/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/Gitignore_ocaml.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +7 -3
- package/project/.sdk/src/cmp/py/Config_py.ts +82 -1
- package/project/.sdk/src/cmp/py/Main_py.ts +44 -0
- package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +2 -0
- package/project/.sdk/src/cmp/swift/Main_swift.ts +10 -0
- package/project/.sdk/src/cmp/swift/Package_swift.ts +13 -1
- package/project/.sdk/src/cmp/ts/Config_ts.ts +42 -17
- package/project/.sdk/src/cmp/ts/fragment/Config.data.fragment.ts +13 -1
- package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +13 -1
- package/project/.sdk/tm/c/Makefile +38 -3
- package/project/.sdk/tm/c/tests/omni_resolver.h +361 -0
- package/project/.sdk/tm/c/tests/omni_smoke_test.c +237 -0
- package/project/.sdk/tm/c/tests/primary_corpus_test.c +205 -284
- package/project/.sdk/tm/c/tests/struct_corpus_test.c +292 -212
- package/project/.sdk/tm/c/tests/vendor/omni/json.c +811 -0
- package/project/.sdk/tm/c/tests/vendor/omni/omni.h +240 -0
- package/project/.sdk/tm/c/tests/vendor/omni/runner.c +940 -0
- package/project/.sdk/tm/c/tests/vendor/omni/util.c +351 -0
- package/project/.sdk/tm/c/utility/struct/utility.c +7 -2
- package/project/.sdk/tm/clojure/test/sdk/test/omni.clj +401 -0
- package/project/.sdk/tm/clojure/test/sdk/test/omni_smoke.clj +81 -0
- package/project/.sdk/tm/clojure/test/sdk/test/primary.clj +92 -58
- package/project/.sdk/tm/clojure/test/sdk/test/struct_corpus.clj +122 -149
- package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +8 -3
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/json.clj +145 -0
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/runner.clj +445 -0
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/util.clj +145 -0
- package/project/.sdk/tm/cpp/Makefile +5 -1
- package/project/.sdk/tm/cpp/test/omni_resolver.hpp +473 -0
- package/project/.sdk/tm/cpp/test/omni_smoke_test.cpp +209 -0
- package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +243 -184
- package/project/.sdk/tm/cpp/test/runner_support.hpp +68 -181
- package/project/.sdk/tm/cpp/test/struct_corpus_test.cpp +183 -56
- package/project/.sdk/tm/cpp/test/vendor/omni/json.hpp +406 -0
- package/project/.sdk/tm/cpp/test/vendor/omni/omni.hpp +751 -0
- package/project/.sdk/tm/cpp/test/vendor/omni/util.hpp +256 -0
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +7 -1
- package/project/.sdk/tm/csharp/test/OmniResolver.cs +491 -0
- package/project/.sdk/tm/csharp/test/OmniSmokeTest.cs +106 -0
- package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +299 -316
- package/project/.sdk/tm/csharp/test/Runner.cs +104 -269
- package/project/.sdk/tm/csharp/test/StructUtilityTest.cs +535 -724
- package/project/.sdk/tm/csharp/test/vendor/omni/Runner.cs +864 -0
- package/project/.sdk/tm/csharp/test/vendor/omni/Util.cs +347 -0
- package/project/.sdk/tm/csharp/utility/MakeSpec.cs +3 -1
- package/project/.sdk/tm/csharp/utility/PrepareMethod.cs +6 -1
- package/project/.sdk/tm/csharp/utility/struct/Struct.cs +21 -5
- package/project/.sdk/tm/dart/test/omni.dart +520 -0
- package/project/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
- package/project/.sdk/tm/dart/test/primary_test.dart +86 -28
- package/project/.sdk/tm/dart/test/struct_test.dart +438 -11
- package/project/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
- package/project/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
- package/project/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
- package/project/.sdk/tm/elixir/Makefile +11 -3
- package/project/.sdk/tm/elixir/test/omni_smoke_test.exs +117 -0
- package/project/.sdk/tm/elixir/test/primary_utility_test.exs +341 -16
- package/project/.sdk/tm/elixir/test/struct_corpus_test.exs +554 -9
- package/project/.sdk/tm/elixir/test/support/omni.ex +377 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/json.ex +122 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/runner.ex +623 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/util.ex +187 -0
- package/project/.sdk/tm/go/core/context.go +32 -16
- package/project/.sdk/tm/go/feature/secrets/plugin/capability.go +261 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/catalog.go +78 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/config.go +652 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/depend.go +250 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/env.go +194 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/export.go +80 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/graph.go +238 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/host.go +1575 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/order.go +248 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/point.go +184 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/ref.go +123 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/resolve.go +79 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/types.go +296 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/util.go +87 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/version.go +161 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/aws.go +292 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/sigv4.go +201 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/azuresecrets/azuresecrets.go +187 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/boru/boru.go +184 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/doppler/doppler.go +114 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/gcpsecrets/gcpsecrets.go +156 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/hashicorp/hashicorp.go +209 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/httpjson/httpjson.go +241 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/infisical/infisical.go +151 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/onepassword/onepassword.go +152 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/secretspec/secretspec.go +143 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/addr.go +120 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/providers.go +439 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +685 -0
- package/project/.sdk/tm/go/feature/secrets_feature.go +675 -0
- package/project/.sdk/tm/go/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +799 -0
- package/project/.sdk/tm/go/test/omni/omni.go +897 -0
- package/project/.sdk/tm/go/test/omni/util.go +360 -0
- package/project/.sdk/tm/go/test/omniresolver_test.go +748 -0
- package/project/.sdk/tm/go/test/omnismoke_test.go +112 -0
- package/project/.sdk/tm/go/test/primary_utility_test.go +123 -191
- package/project/.sdk/tm/go/test/struct_utility_test.go +323 -16
- package/project/.sdk/tm/go/test/testsupport_test.go +294 -0
- package/project/.sdk/tm/go/utility/make_options.go +8 -1
- package/project/.sdk/tm/go/utility/prepare_method.go +5 -1
- package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +2 -2
- package/project/.sdk/tm/java/test/OmniResolver.java +355 -0
- package/project/.sdk/tm/java/test/OmniSmokeTest.java +99 -0
- package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +254 -280
- package/project/.sdk/tm/java/test/RunnerSupport.java +9 -194
- package/project/.sdk/tm/java/test/StructCorpusTest.java +119 -42
- package/project/.sdk/tm/java/test/vendor/omni/Json.java +287 -0
- package/project/.sdk/tm/java/test/vendor/omni/Runner.java +851 -0
- package/project/.sdk/tm/java/test/vendor/omni/Util.java +322 -0
- package/project/.sdk/tm/java/utility/MakeSpec.java +3 -1
- package/project/.sdk/tm/java/utility/PrepareMethod.java +5 -5
- package/project/.sdk/tm/java/utility/struct/Struct.java +17 -4
- package/project/.sdk/tm/js/src/utility/StructUtility.js +3 -3
- package/project/.sdk/tm/js/test/omni.js +251 -0
- package/project/.sdk/tm/js/test/omni.test.js +105 -0
- package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +6 -2
- package/project/.sdk/tm/js/test/utility/StructUtility.test.js +27 -2
- package/project/.sdk/tm/js/test/vendor/omni/index.js +77 -0
- package/project/.sdk/tm/js/test/vendor/omni/runner.js +613 -0
- package/project/.sdk/tm/js/test/vendor/omni/util.js +212 -0
- package/project/.sdk/tm/kotlin/core/Utility.kt +1 -1
- package/project/.sdk/tm/kotlin/test/OmniResolver.kt +343 -0
- package/project/.sdk/tm/kotlin/test/OmniSmokeTest.kt +100 -0
- package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +244 -262
- package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +9 -178
- package/project/.sdk/tm/kotlin/test/StructCorpusTest.kt +121 -32
- package/project/.sdk/tm/kotlin/test/vendor/omni/Json.kt +264 -0
- package/project/.sdk/tm/kotlin/test/vendor/omni/Runner.kt +615 -0
- package/project/.sdk/tm/kotlin/test/vendor/omni/Util.kt +139 -0
- package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +6 -3
- package/project/.sdk/tm/kotlin/utility/Prepare.kt +6 -6
- package/project/.sdk/tm/kotlin/utility/struct/Struct.kt +18 -2
- package/project/.sdk/tm/lean/Makefile +12 -5
- package/project/.sdk/tm/lean/src/SdkUtility.lean +14 -1
- package/project/.sdk/tm/lean/test/OmniResolver.lean +358 -0
- package/project/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
- package/project/.sdk/tm/lean/test/StructCorpus.lean +245 -574
- package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +155 -291
- package/project/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
- package/project/.sdk/tm/lua/test/omni.lua +456 -0
- package/project/.sdk/tm/lua/test/omni_smoke_test.lua +103 -0
- package/project/.sdk/tm/lua/test/primary_utility_test.lua +250 -509
- package/project/.sdk/tm/lua/test/struct_utility_test.lua +161 -70
- package/project/.sdk/tm/lua/test/vendor/omni/json.lua +268 -0
- package/project/.sdk/tm/lua/test/vendor/omni/regex.lua +385 -0
- package/project/.sdk/tm/lua/test/vendor/omni/runner.lua +641 -0
- package/project/.sdk/tm/lua/test/vendor/omni/util.lua +282 -0
- package/project/.sdk/tm/lua/utility/prepare_method.lua +5 -1
- package/project/.sdk/tm/lua/utility/struct/regex.lua +663 -0
- package/project/.sdk/tm/lua/utility/struct/struct.lua +660 -420
- package/project/.sdk/tm/ocaml/Makefile +37 -12
- package/project/.sdk/tm/ocaml/test/omni_resolver.ml +284 -0
- package/project/.sdk/tm/ocaml/test/omni_smoke_test.ml +169 -0
- package/project/.sdk/tm/ocaml/test/primary_utility_test.ml +84 -100
- package/project/.sdk/tm/ocaml/test/struct_corpus.ml +225 -201
- package/project/.sdk/tm/ocaml/test/vendor/omni/omni.ml +1157 -0
- package/project/.sdk/tm/perl/lib/Voxgig/Struct.pm +88 -12
- package/project/.sdk/tm/perl/t/omni.pm +647 -0
- package/project/.sdk/tm/perl/t/omni_smoke.t +87 -0
- package/project/.sdk/tm/perl/t/primary_utility.t +189 -487
- package/project/.sdk/tm/perl/t/struct_utility.t +455 -389
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Runner.pm +649 -0
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Util.pm +253 -0
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni.pm +24 -0
- package/project/.sdk/tm/perl/utility/prepare_method.pm +7 -2
- package/project/.sdk/tm/php/test/Omni.php +691 -0
- package/project/.sdk/tm/php/test/OmniSmokeTest.php +93 -0
- package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +210 -571
- package/project/.sdk/tm/php/test/StructUtilityTest.php +320 -342
- package/project/.sdk/tm/php/test/vendor/omni/Runner.php +644 -0
- package/project/.sdk/tm/php/test/vendor/omni/Util.php +283 -0
- package/project/.sdk/tm/php/utility/MakeSpec.php +10 -3
- package/project/.sdk/tm/php/utility/PrepareBody.php +7 -1
- package/project/.sdk/tm/php/utility/PrepareMethod.php +6 -2
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/__init__.py +36 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/capability.py +141 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/catalog.py +50 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/config.py +333 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/depend.py +198 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/env.py +147 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/export.py +52 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/graph.py +139 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/host.py +1053 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/order.py +171 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/point.py +95 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/ref.py +116 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/resolve.py +59 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/types.py +87 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/version.py +112 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/__init__.py +74 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/addr.py +116 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/aws.py +192 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/azuresecrets.py +120 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/boru.py +140 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/doppler.py +62 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/gcpsecrets.py +101 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/hashicorp.py +152 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/httpjson.py +115 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/infisical.py +92 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/onepassword.py +101 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/secretspec.py +119 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/sigv4.py +125 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/providers.py +211 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/sekreto.py +455 -0
- package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +467 -0
- package/project/.sdk/tm/py/pkg/utility/prepare_method.py +5 -1
- package/project/.sdk/tm/py/pkg/utility/voxgig_struct/__init__.py +0 -2
- package/project/.sdk/tm/py/pkg/utility/voxgig_struct/voxgig_struct.py +780 -529
- package/project/.sdk/tm/py/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/py/test/feature/__init__.py +0 -0
- package/project/.sdk/tm/py/test/feature/secrets/__init__.py +0 -0
- package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +337 -0
- package/project/.sdk/tm/py/test/omni.py +415 -0
- package/project/.sdk/tm/py/test/test_omni_smoke.py +74 -0
- package/project/.sdk/tm/py/test/test_primary_utility.py +144 -668
- package/project/.sdk/tm/py/test/test_struct_utility.py +74 -27
- package/project/.sdk/tm/py/test/voxgig_omni/__init__.py +62 -0
- package/project/.sdk/tm/py/test/voxgig_omni/runner.py +566 -0
- package/project/.sdk/tm/py/test/voxgig_omni/util.py +237 -0
- package/project/.sdk/tm/rb/test/omni.rb +505 -0
- package/project/.sdk/tm/rb/test/omni_smoke_test.rb +72 -0
- package/project/.sdk/tm/rb/test/primary_utility_test.rb +174 -560
- package/project/.sdk/tm/rb/test/struct_utility_test.rb +13 -7
- package/project/.sdk/tm/rb/test/vendor/omni/runner.rb +493 -0
- package/project/.sdk/tm/rb/test/vendor/omni/util.rb +199 -0
- package/project/.sdk/tm/rb/test/vendor/omni/voxgig_omni.rb +15 -0
- package/project/.sdk/tm/rb/utility/prepare_method.rb +5 -1
- package/project/.sdk/tm/rust/tests/common/mod.rs +19 -242
- package/project/.sdk/tm/rust/tests/omni_resolver/mod.rs +888 -0
- package/project/.sdk/tm/rust/tests/omni_smoke_test.rs +286 -0
- package/project/.sdk/tm/rust/tests/primary_utility_test.rs +318 -312
- package/project/.sdk/tm/rust/tests/struct_utility_test.rs +66 -28
- package/project/.sdk/tm/rust/tests/vendor/omni/json.rs +412 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/mod.rs +38 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/regex.rs +392 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/runner.rs +1001 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/util.rs +161 -0
- package/project/.sdk/tm/rust/utility/prepare_method.rs +5 -1
- package/project/.sdk/tm/scala/Makefile +16 -6
- package/project/.sdk/tm/scala/sdktest/OmniResolver.scala +497 -0
- package/project/.sdk/tm/scala/sdktest/OmniSmoke.scala +192 -0
- package/project/.sdk/tm/scala/sdktest/PrimaryCorpus.scala +47 -19
- package/project/.sdk/tm/scala/sdktest/StructCorpus.scala +0 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Json.scala +229 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Runner.scala +552 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Util.scala +104 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Constants.swift +10 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Inject.swift +28 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Injection.swift +5 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Minor.swift +4 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Validate.swift +15 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Prepare.swift +6 -1
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniResolver.swift +474 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniSmokeTest.swift +107 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +141 -178
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/Runner.swift +17 -113
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/StructUtilityTest.swift +295 -446
- package/project/.sdk/tm/swift/Tests/vendor/omni/Json.swift +364 -0
- package/project/.sdk/tm/swift/Tests/vendor/omni/Runner.swift +730 -0
- package/project/.sdk/tm/swift/Tests/vendor/omni/Util.swift +162 -0
- package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +7 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Capability.ts +148 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Catalog.ts +55 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Config.ts +344 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Depend.ts +205 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Env.ts +138 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Export.ts +46 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/FeatureHost.ts +349 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Graph.ts +181 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Host.ts +1132 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Order.ts +177 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Point.ts +119 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Ref.ts +102 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Resolve.ts +61 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Types.ts +112 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Version.ts +100 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/index.ts +37 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/Sekreto.ts +163 -30
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/index.ts +27 -22
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/aws.ts +26 -36
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/azuresecrets.ts +19 -21
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/boru.ts +36 -17
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/doppler.ts +14 -21
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/gcpsecrets.ts +27 -27
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/hashicorp.ts +25 -39
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/httpjson.ts +99 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/infisical.ts +14 -16
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/onepassword.ts +15 -22
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/secretspec.ts +98 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{Sigv4.ts → plugins/sigv4.ts} +7 -6
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/addr.ts +97 -23
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/builtin.ts +37 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/dotenv.ts +4 -17
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/env.ts +4 -16
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/file.ts +11 -25
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/memory.ts +6 -23
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/support.ts +106 -39
- package/project/.sdk/tm/ts/src/utility/StructUtility.ts +3 -3
- package/project/.sdk/tm/ts/test/omni.ts +104 -32
- package/project/.sdk/tm/ts/test/utility/StructUtility.test.ts +27 -0
- package/project/.sdk/tm/ts/test/vendor/omni/Runner.ts +32 -5
- package/project/.sdk/tm/ts/test/vendor/omni/Util.ts +2 -2
- package/project/.sdk/tm/ts/test/vendor/omni/index.ts +2 -2
- package/project/.sdk/tm/zig/test/primary_utility_test.zig +1 -1
- package/project/.sdk/tm/zig/test/struct_runner.zig +5 -4
- package/project/sdkgen-package.json +1 -1
- package/src/action/doctor.ts +66 -2
- package/src/helpers/naming.ts +4 -2
- package/project/.sdk/tm/c/tests/runner.h +0 -274
- package/project/.sdk/tm/cpp/test/struct_runner.hpp +0 -314
- package/project/.sdk/tm/csharp/test/StructRunner.cs +0 -276
- package/project/.sdk/tm/dart/test/runner.dart +0 -406
- package/project/.sdk/tm/dart/test/struct_corpus.dart +0 -531
- package/project/.sdk/tm/elixir/test/support/struct_corpus.ex +0 -1088
- package/project/.sdk/tm/go/test/runner_test.go +0 -629
- package/project/.sdk/tm/go/test/struct_runner_test.go +0 -1094
- package/project/.sdk/tm/java/test/StructRunner.java +0 -281
- package/project/.sdk/tm/js/test/runner.js +0 -387
- package/project/.sdk/tm/kotlin/test/StructRunner.kt +0 -177
- package/project/.sdk/tm/lua/test/struct_runner.lua +0 -602
- package/project/.sdk/tm/ocaml/test/corpus_runner.ml +0 -185
- package/project/.sdk/tm/perl/t/struct_runner.pm +0 -275
- package/project/.sdk/tm/php/test/StructRunner.php +0 -275
- package/project/.sdk/tm/py/test/struct_runner.py +0 -411
- package/project/.sdk/tm/rb/test/struct_runner.rb +0 -309
- package/project/.sdk/tm/rust/tests/struct_runner/mod.rs +0 -424
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/Registry.ts +0 -90
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/http.ts +0 -66
- package/project/.sdk/tm/ts/test/vendor/omni/compat.ts +0 -188
|
@@ -0,0 +1,623 @@
|
|
|
1
|
+
# VENDORED: @voxgig/omni sdk-20260904-1610-0 (elixir/lib/runner.ex)
|
|
2
|
+
# Source: https://github.com/voxgig/omni @ 8c3e1b573a8d35796f7fc45e3226b977023cabf7 [tag: sdk-20260904-1610-0]
|
|
3
|
+
# License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
# Omni: the shared multi-language test runner (Elixir port).
|
|
5
|
+
#
|
|
6
|
+
# Port of the canonical TypeScript implementation
|
|
7
|
+
# (typescript/src/Runner.ts). Behaviour must match, case for case.
|
|
8
|
+
|
|
9
|
+
defmodule Voxgig.Omni.OmniError do
|
|
10
|
+
@moduledoc """
|
|
11
|
+
A test failure (or a malformed spec). Distinct from an exception raised
|
|
12
|
+
by the subject under test, which is a candidate for an `err` expectation.
|
|
13
|
+
"""
|
|
14
|
+
defexception [:message, :entry]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
defmodule Voxgig.Omni.Runner do
|
|
18
|
+
@moduledoc "The omni test runner."
|
|
19
|
+
|
|
20
|
+
alias Voxgig.Omni.OmniError
|
|
21
|
+
alias Voxgig.Omni.Json
|
|
22
|
+
alias Voxgig.Omni.Util, as: U
|
|
23
|
+
|
|
24
|
+
@doc """
|
|
25
|
+
The newest spec format version this runner understands. A spec with no
|
|
26
|
+
OMNI block is version 0: the original, lenient format, frozen forever.
|
|
27
|
+
Version 1 turns on strict entry validation (see checkentry/3).
|
|
28
|
+
"""
|
|
29
|
+
def specversion, do: 1
|
|
30
|
+
|
|
31
|
+
@doc """
|
|
32
|
+
Capability strings this runner supports beyond the version baseline. A
|
|
33
|
+
spec's OMNI.requires list is checked against this: an unknown capability
|
|
34
|
+
refuses the spec loudly at load time, instead of a lagging port silently
|
|
35
|
+
mis-running it. (Empty today; future format features mint a string here.)
|
|
36
|
+
"""
|
|
37
|
+
def capabilities, do: []
|
|
38
|
+
|
|
39
|
+
# The complete set of fields an entry may carry. Under version 1 anything
|
|
40
|
+
# else is an error: an unrecognised key is almost always a typo'd
|
|
41
|
+
# assertion, and a typo'd assertion is a test that silently stopped
|
|
42
|
+
# testing.
|
|
43
|
+
@entryfields ~w(in args ctx out err match client id doc)
|
|
44
|
+
|
|
45
|
+
@doc "Load a spec: a path to a JSON file."
|
|
46
|
+
def loadspec(path) do
|
|
47
|
+
case File.read(path) do
|
|
48
|
+
{:ok, text} -> Json.parse(text)
|
|
49
|
+
{:error, _} -> raise OmniError, message: "omni: cannot read spec: #{path}"
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Read the spec's format version from its optional top-level OMNI block,
|
|
54
|
+
# and refuse a spec this runner cannot faithfully run: a version newer
|
|
55
|
+
# than specversion/0, or a required capability not in capabilities/0.
|
|
56
|
+
defp resolveversion(alltests) do
|
|
57
|
+
hasomni = U.ismap(alltests) and Map.has_key?(alltests, "OMNI")
|
|
58
|
+
|
|
59
|
+
if not hasomni do
|
|
60
|
+
0
|
|
61
|
+
else
|
|
62
|
+
meta = Map.get(alltests, "OMNI")
|
|
63
|
+
version = U.get(meta, "version")
|
|
64
|
+
numversion = if U.isnum(version), do: version / 1, else: nil
|
|
65
|
+
|
|
66
|
+
if not U.ismap(meta) or is_nil(numversion) or Float.round(numversion) != numversion do
|
|
67
|
+
raise OmniError, message: "omni: malformed OMNI version block"
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
if version < 0 or specversion() < version do
|
|
71
|
+
raise OmniError, message: "omni: unsupported spec version: #{U.stringify(version)}"
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
if U.has(meta, "requires") do
|
|
75
|
+
requires = U.get(meta, "requires")
|
|
76
|
+
|
|
77
|
+
if not U.islist(requires) do
|
|
78
|
+
raise OmniError, message: "omni: malformed OMNI requires list"
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
Enum.each(requires, fn cap ->
|
|
82
|
+
if not (U.isstr(cap) and cap in capabilities()) do
|
|
83
|
+
raise OmniError,
|
|
84
|
+
message: "omni: spec requires unsupported capability: #{U.stringify(cap)}"
|
|
85
|
+
end
|
|
86
|
+
end)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
version
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Strict entry validation, applied when the spec declares version 1 or
|
|
94
|
+
# later. The lenient format converts each of these mistakes into a
|
|
95
|
+
# silent pass or a dead field; here they fail with the entry named.
|
|
96
|
+
defp checkentry(label, index, entry) do
|
|
97
|
+
if not U.ismap(entry) do
|
|
98
|
+
raise fail(label, index, entry, "entry is not a map", nil, nil)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
Enum.each(Map.keys(entry), fn key ->
|
|
102
|
+
if key not in @entryfields do
|
|
103
|
+
raise fail(label, index, entry, "unknown entry field: #{key}", nil, nil)
|
|
104
|
+
end
|
|
105
|
+
end)
|
|
106
|
+
|
|
107
|
+
argsources = Enum.count(["in", "args", "ctx"], &Map.has_key?(entry, &1))
|
|
108
|
+
|
|
109
|
+
if argsources > 1 do
|
|
110
|
+
raise fail(label, index, entry, "entry has more than one of in, args, ctx", nil, nil)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
entryerr = U.get(entry, "err")
|
|
114
|
+
|
|
115
|
+
if not U.isnone(entryerr) and Map.has_key?(entry, "out") do
|
|
116
|
+
raise fail(label, index, entry, "entry has both err and out", nil, nil)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if Map.has_key?(entry, "id") and not U.isstr(U.get(entry, "id")) do
|
|
120
|
+
raise fail(label, index, entry, "entry id is not a string", nil, nil)
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Validate a version-1 group up front, against the AUTHORED entries -
|
|
125
|
+
# null-normalisation would otherwise rewrite an authored null (e.g.
|
|
126
|
+
# id: null) into a sentinel string and hide it from validation. A
|
|
127
|
+
# malformed spec is a spec error, not a test result, so it fails
|
|
128
|
+
# before any subject runs.
|
|
129
|
+
defp checkset(label, testspec, normalset) do
|
|
130
|
+
origset =
|
|
131
|
+
if U.ismap(testspec) and U.islist(U.get(testspec, "set")) do
|
|
132
|
+
U.get(testspec, "set")
|
|
133
|
+
else
|
|
134
|
+
normalset
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
emptyflag = if U.ismap(testspec), do: U.get(testspec, "empty"), else: U.absent()
|
|
138
|
+
|
|
139
|
+
if [] == origset and true != emptyflag do
|
|
140
|
+
raise OmniError, message: "omni: empty test set: #{label}"
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
origset
|
|
144
|
+
|> Enum.with_index()
|
|
145
|
+
|> Enum.each(fn {entry, index} -> checkentry(label, index, entry) end)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
@doc "Find `primary.<name>`, then `<name>`, then the whole spec."
|
|
149
|
+
def resolvespec(name, alltests) do
|
|
150
|
+
primary = U.get(U.get(alltests, "primary"), name)
|
|
151
|
+
section = U.get(alltests, name)
|
|
152
|
+
|
|
153
|
+
cond do
|
|
154
|
+
is_nil(name) or "" == name -> alltests
|
|
155
|
+
not U.isabsent(primary) -> primary
|
|
156
|
+
not U.isabsent(section) -> section
|
|
157
|
+
true -> alltests
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
@doc "Nulls (and absent values) become NULLMARK. Always a fresh copy."
|
|
162
|
+
def fixjson(val, donull) do
|
|
163
|
+
cond do
|
|
164
|
+
# Canonical returns the value UNCHANGED when donull is false
|
|
165
|
+
# (typescript/src/Runner.ts): absent stays absent and nil stays nil.
|
|
166
|
+
# Answering nil for both collapsed two states the corpus distinguishes,
|
|
167
|
+
# so a subject that correctly returned nothing was compared against null
|
|
168
|
+
# and marked wrong. Same defect the other ports carried (#17, #23, #25,
|
|
169
|
+
# #26); this one was missed because no consumer had exercised it.
|
|
170
|
+
U.isnone(val) -> if donull, do: U.nullmark(), else: val
|
|
171
|
+
U.islist(val) -> Enum.map(val, &fixjson(&1, donull))
|
|
172
|
+
U.ismap(val) -> Map.new(val, fn {key, entry} -> {key, fixjson(entry, donull)} end)
|
|
173
|
+
true -> val
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
@doc "The JSON form of an error: always at least {name,message}."
|
|
178
|
+
def errify(err) do
|
|
179
|
+
%{"name" => err.__struct__ |> Module.split() |> List.last(), "message" => errmessage(err)}
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
@doc """
|
|
183
|
+
The error base a `match.err` sees: the provider's own, when it has one.
|
|
184
|
+
|
|
185
|
+
A library whose errors carry a code reaches `match: {err: {code}}`
|
|
186
|
+
through the provider's `:errify`, which REPLACES `errify/1` rather than
|
|
187
|
+
adding to it.
|
|
188
|
+
"""
|
|
189
|
+
def errbase(err, provider) do
|
|
190
|
+
case is_map(provider) and Map.get(provider, :errify) do
|
|
191
|
+
hook when is_function(hook, 1) -> hook.(err)
|
|
192
|
+
_ -> errify(err)
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
@doc "The message an `err` expectation matches."
|
|
197
|
+
def errmessage(%{message: message}) when is_binary(message), do: message
|
|
198
|
+
def errmessage(err) when is_exception(err), do: Exception.message(err)
|
|
199
|
+
def errmessage(err), do: to_string(err)
|
|
200
|
+
|
|
201
|
+
@doc "Match one leaf: /regex/ or case-insensitive substring for strings."
|
|
202
|
+
def matchval(check, base) do
|
|
203
|
+
want =
|
|
204
|
+
if check == U.undefmark() or check == U.nullmark() do
|
|
205
|
+
nil
|
|
206
|
+
else
|
|
207
|
+
check
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
cond do
|
|
211
|
+
U.deepequal(check, base) ->
|
|
212
|
+
true
|
|
213
|
+
|
|
214
|
+
is_nil(want) ->
|
|
215
|
+
U.isnone(base) or U.nullmark() == base
|
|
216
|
+
|
|
217
|
+
# An empty want is not a wildcard: the empty string is a substring of
|
|
218
|
+
# everything, so `match:{out:""}` (or `err:""`) would accept any value.
|
|
219
|
+
U.isstr(want) and "" == want ->
|
|
220
|
+
"" == base
|
|
221
|
+
|
|
222
|
+
U.isstr(want) ->
|
|
223
|
+
basestr = U.stringify(base)
|
|
224
|
+
|
|
225
|
+
if 2 < String.length(want) and String.starts_with?(want, "/") and
|
|
226
|
+
String.ends_with?(want, "/") do
|
|
227
|
+
pattern = String.slice(want, 1..-2//1)
|
|
228
|
+
|
|
229
|
+
case Regex.compile(pattern) do
|
|
230
|
+
{:ok, regex} -> Regex.match?(regex, basestr)
|
|
231
|
+
{:error, _} -> false
|
|
232
|
+
end
|
|
233
|
+
else
|
|
234
|
+
String.contains?(String.downcase(basestr), String.downcase(want))
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
true ->
|
|
238
|
+
U.deepequal(want, base)
|
|
239
|
+
end
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
@doc "Convert NULLMARK sentinels back into real nulls."
|
|
243
|
+
def nullmodifier(val) do
|
|
244
|
+
cond do
|
|
245
|
+
U.nullmark() == val -> nil
|
|
246
|
+
U.isstr(val) -> String.replace(val, U.nullmark(), "null")
|
|
247
|
+
true -> val
|
|
248
|
+
end
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
@doc """
|
|
252
|
+
Make a runner for a spec file path (or spec value) and a provider.
|
|
253
|
+
|
|
254
|
+
Returns a function of `(name, store)` producing a run pack: a map with
|
|
255
|
+
`:spec`, `:set`, `:runset`, `:runsetflags`, `:subject` and `:client`.
|
|
256
|
+
"""
|
|
257
|
+
def make_runner(specref, provider \\ %{}) do
|
|
258
|
+
alltests = if is_binary(specref), do: loadspec(specref), else: specref
|
|
259
|
+
specversion = resolveversion(alltests)
|
|
260
|
+
|
|
261
|
+
fn name, store ->
|
|
262
|
+
spec = resolvespec(name, alltests)
|
|
263
|
+
clients = resolveclients(provider, spec, store)
|
|
264
|
+
|
|
265
|
+
subject =
|
|
266
|
+
case Map.get(provider, :subject) do
|
|
267
|
+
nil -> nil
|
|
268
|
+
resolve -> resolve.(name)
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
runpack = %{
|
|
272
|
+
spec: spec,
|
|
273
|
+
subject: subject,
|
|
274
|
+
provider: provider,
|
|
275
|
+
clients: clients,
|
|
276
|
+
name: name,
|
|
277
|
+
specversion: specversion
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
runsetflags = fn testspec, flags, testsubject ->
|
|
281
|
+
run_set_flags(runpack, testspec, flags, testsubject, false)
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
runsetflags_args = fn testspec, flags, testsubject ->
|
|
285
|
+
run_set_flags(runpack, testspec, flags, testsubject, true)
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
%{
|
|
289
|
+
spec: spec,
|
|
290
|
+
subject: subject,
|
|
291
|
+
client: provider,
|
|
292
|
+
set: fn setname -> U.get(spec, setname) end,
|
|
293
|
+
runsetflags: runsetflags,
|
|
294
|
+
runsetflags_args: runsetflags_args,
|
|
295
|
+
runset: fn testspec, testsubject -> runsetflags.(testspec, %{}, testsubject) end
|
|
296
|
+
}
|
|
297
|
+
end
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
# A spec may define clients that a given test run never references.
|
|
301
|
+
defp resolveclients(provider, spec, store) do
|
|
302
|
+
defclient = U.get(U.get(spec, "DEF"), "client")
|
|
303
|
+
clientmaker = Map.get(provider, :client)
|
|
304
|
+
|
|
305
|
+
if U.ismap(defclient) and not is_nil(clientmaker) do
|
|
306
|
+
Map.new(defclient, fn {clientname, cdef} ->
|
|
307
|
+
copts = U.get(U.get(cdef, "test"), "options")
|
|
308
|
+
copts = if U.isabsent(copts), do: %{}, else: copts
|
|
309
|
+
|
|
310
|
+
copts =
|
|
311
|
+
case Map.get(provider, :inject) do
|
|
312
|
+
nil -> copts
|
|
313
|
+
inject -> if U.ismap(store), do: inject.(copts, store), else: copts
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
{clientname, clientmaker.(copts)}
|
|
317
|
+
end)
|
|
318
|
+
else
|
|
319
|
+
%{}
|
|
320
|
+
end
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
# `argsmode` selects the subject contract: a plain subject returns the
|
|
324
|
+
# result, while an ARGS subject returns `{args, result}`.
|
|
325
|
+
#
|
|
326
|
+
# `match.args` asserts an IN-PLACE rewrite - `minor/setpath` in eight of its
|
|
327
|
+
# nine entries, `merge/integrity` in all six - and nothing on the BEAM is
|
|
328
|
+
# mutable, so a consumer holding a converted copy cannot write through the
|
|
329
|
+
# argument list. Returning it is the only channel there is. omni-rust,
|
|
330
|
+
# omni-cpp and omni-ocaml carry the same second entry point, for the same
|
|
331
|
+
# reason; the dynamic ports need none, because the value is shared.
|
|
332
|
+
defp run_set_flags(runpack, testspec, flags, testsubject, argsmode) do
|
|
333
|
+
donull = Map.get(flags, :null, true)
|
|
334
|
+
label = Map.get(flags, :name) || if("" == runpack.name, do: "set", else: runpack.name)
|
|
335
|
+
|
|
336
|
+
usesubject = testsubject || runpack.subject
|
|
337
|
+
|
|
338
|
+
if is_nil(usesubject) do
|
|
339
|
+
raise OmniError, message: "omni: no test subject for: #{label}"
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
testspecmap = fixjson(testspec, donull)
|
|
343
|
+
testset = U.get(testspecmap, "set")
|
|
344
|
+
|
|
345
|
+
if not U.islist(testset) do
|
|
346
|
+
raise OmniError, message: "omni: test spec has no set: #{label}"
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
if 1 <= runpack.specversion do
|
|
350
|
+
checkset(label, testspec, testset)
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
testset
|
|
354
|
+
|> Enum.with_index()
|
|
355
|
+
|> Enum.each(fn {rawentry, index} ->
|
|
356
|
+
if not U.ismap(rawentry) do
|
|
357
|
+
raise OmniError, message: "omni: #{label}[#{index}]: entry is not a map"
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
run_entry(runpack, label, index, rawentry, donull, usesubject, argsmode)
|
|
361
|
+
end)
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
defp run_entry(runpack, label, index, rawentry, donull, usesubject, argsmode) do
|
|
365
|
+
# An entry with no `out` expects a null (or absent) result.
|
|
366
|
+
entry =
|
|
367
|
+
if donull and U.isnone(U.get(rawentry, "out")) do
|
|
368
|
+
Map.put(rawentry, "out", U.nullmark())
|
|
369
|
+
else
|
|
370
|
+
rawentry
|
|
371
|
+
end
|
|
372
|
+
|
|
373
|
+
testpack = resolvetestpack(runpack, entry, usesubject)
|
|
374
|
+
{args, entry} = resolveargs(runpack, entry, testpack)
|
|
375
|
+
|
|
376
|
+
try do
|
|
377
|
+
if argsmode do
|
|
378
|
+
{:ok, testpack.subject.(args)}
|
|
379
|
+
else
|
|
380
|
+
{:ok, {args, testpack.subject.(args)}}
|
|
381
|
+
end
|
|
382
|
+
rescue
|
|
383
|
+
omnierr in OmniError -> reraise(omnierr, __STACKTRACE__)
|
|
384
|
+
err -> {:error, err}
|
|
385
|
+
end
|
|
386
|
+
|> case do
|
|
387
|
+
{:ok, {callargs, rawres}} ->
|
|
388
|
+
res = fixjson(rawres, donull)
|
|
389
|
+
checkresult(label, index, Map.put(entry, "res", res), callargs, res)
|
|
390
|
+
|
|
391
|
+
{:error, err} ->
|
|
392
|
+
handleerror(label, index, entry, err, runpack.provider)
|
|
393
|
+
end
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
# Resolve the client and subject for one entry: the entry's own `client`
|
|
397
|
+
# override when present (looked up in the spec's DEF.client clients),
|
|
398
|
+
# else the root provider.
|
|
399
|
+
defp resolvetestpack(runpack, entry, usesubject) do
|
|
400
|
+
case U.get(entry, "client") do
|
|
401
|
+
clientname when is_binary(clientname) ->
|
|
402
|
+
client =
|
|
403
|
+
Map.get(runpack.clients, clientname) ||
|
|
404
|
+
raise(OmniError, message: "omni: unknown client: #{clientname}", entry: entry)
|
|
405
|
+
|
|
406
|
+
subject =
|
|
407
|
+
case Map.get(client, :subject) do
|
|
408
|
+
nil -> usesubject
|
|
409
|
+
resolve -> resolve.(runpack.name) || usesubject
|
|
410
|
+
end
|
|
411
|
+
|
|
412
|
+
%{client: client, subject: subject}
|
|
413
|
+
|
|
414
|
+
_ ->
|
|
415
|
+
%{client: runpack.provider, subject: usesubject}
|
|
416
|
+
end
|
|
417
|
+
end
|
|
418
|
+
|
|
419
|
+
# Build the argument list: `ctx`, `args`, or `in`. A map `ctx`/`args[0]`
|
|
420
|
+
# is passed through the provider's contextify hook, then stamped with
|
|
421
|
+
# the resolved client (the one testpack.subject will actually run
|
|
422
|
+
# against), so a context-aware subject can see what served it.
|
|
423
|
+
defp resolveargs(runpack, entry, testpack) do
|
|
424
|
+
hasctx = U.has(entry, "ctx")
|
|
425
|
+
hasargs = U.has(entry, "args")
|
|
426
|
+
|
|
427
|
+
args =
|
|
428
|
+
cond do
|
|
429
|
+
hasctx ->
|
|
430
|
+
[U.get(entry, "ctx")]
|
|
431
|
+
|
|
432
|
+
hasargs ->
|
|
433
|
+
raw = U.get(entry, "args")
|
|
434
|
+
if U.islist(raw), do: raw, else: [raw]
|
|
435
|
+
|
|
436
|
+
true ->
|
|
437
|
+
[U.clone(U.get(entry, "in"))]
|
|
438
|
+
end
|
|
439
|
+
|
|
440
|
+
if (hasctx or hasargs) and [] != args and U.ismap(hd(args)) do
|
|
441
|
+
first =
|
|
442
|
+
case Map.get(runpack.provider, :contextify) do
|
|
443
|
+
nil -> hd(args)
|
|
444
|
+
contextify -> contextify.(hd(args))
|
|
445
|
+
end
|
|
446
|
+
|
|
447
|
+
first = Map.put(first, "client", testpack.client)
|
|
448
|
+
|
|
449
|
+
{[first | tl(args)], Map.put(entry, "ctx", first)}
|
|
450
|
+
else
|
|
451
|
+
{args, entry}
|
|
452
|
+
end
|
|
453
|
+
end
|
|
454
|
+
|
|
455
|
+
defp checkresult(label, index, entry, args, res) do
|
|
456
|
+
entryerr = U.get(entry, "err")
|
|
457
|
+
check = U.get(entry, "match")
|
|
458
|
+
|
|
459
|
+
if not U.isnone(entryerr) do
|
|
460
|
+
raise fail(label, index, entry, "expected error did not occur",
|
|
461
|
+
U.stringify(entryerr), U.stringify(res))
|
|
462
|
+
end
|
|
463
|
+
|
|
464
|
+
matched =
|
|
465
|
+
if not U.isnone(check) do
|
|
466
|
+
base = %{
|
|
467
|
+
"in" => U.get(entry, "in"),
|
|
468
|
+
"args" => args,
|
|
469
|
+
"out" => U.get(entry, "res"),
|
|
470
|
+
"ctx" => U.get(entry, "ctx")
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
match(label, index, entry, check, base)
|
|
474
|
+
true
|
|
475
|
+
else
|
|
476
|
+
false
|
|
477
|
+
end
|
|
478
|
+
|
|
479
|
+
out = U.get(entry, "out")
|
|
480
|
+
|
|
481
|
+
cond do
|
|
482
|
+
U.deepequal(res, out) ->
|
|
483
|
+
:ok
|
|
484
|
+
|
|
485
|
+
# NOTE: a match with no explicit out is a complete check on its own.
|
|
486
|
+
matched and (U.isnone(out) or U.nullmark() == out) ->
|
|
487
|
+
:ok
|
|
488
|
+
|
|
489
|
+
true ->
|
|
490
|
+
raise fail(label, index, entry, "result mismatch", U.stringify(out), U.stringify(res))
|
|
491
|
+
end
|
|
492
|
+
end
|
|
493
|
+
|
|
494
|
+
defp handleerror(label, index, entry, err, provider) do
|
|
495
|
+
entryerr = U.get(entry, "err")
|
|
496
|
+
message = errmessage(err)
|
|
497
|
+
|
|
498
|
+
if U.isnone(entryerr) do
|
|
499
|
+
raise fail(label, index, entry, "unexpected error", nil, message)
|
|
500
|
+
end
|
|
501
|
+
|
|
502
|
+
if true == entryerr or matchval(entryerr, message) do
|
|
503
|
+
check = U.get(entry, "match")
|
|
504
|
+
|
|
505
|
+
if not U.isnone(check) do
|
|
506
|
+
base = %{
|
|
507
|
+
"in" => U.get(entry, "in"),
|
|
508
|
+
"out" => U.get(entry, "res"),
|
|
509
|
+
"ctx" => U.get(entry, "ctx"),
|
|
510
|
+
"err" => errbase(err, provider)
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
match(label, index, entry, check, base)
|
|
514
|
+
end
|
|
515
|
+
|
|
516
|
+
:ok
|
|
517
|
+
else
|
|
518
|
+
raise fail(label, index, entry, "error mismatch", U.stringify(entryerr), message)
|
|
519
|
+
end
|
|
520
|
+
end
|
|
521
|
+
|
|
522
|
+
@doc "Check that every leaf of `check` is present, and matches, in `base`."
|
|
523
|
+
def match(label, index, entry, check, base, path \\ []) do
|
|
524
|
+
where = if [] == path, do: "<root>", else: U.pathify(path)
|
|
525
|
+
|
|
526
|
+
cond do
|
|
527
|
+
U.islist(check) ->
|
|
528
|
+
check
|
|
529
|
+
|> Enum.with_index()
|
|
530
|
+
|> Enum.each(fn {subcheck, at} ->
|
|
531
|
+
match(label, index, entry, subcheck, base, path ++ [to_string(at)])
|
|
532
|
+
end)
|
|
533
|
+
|
|
534
|
+
U.ismap(check) ->
|
|
535
|
+
Enum.each(check, fn {key, subcheck} ->
|
|
536
|
+
match(label, index, entry, subcheck, base, path ++ [key])
|
|
537
|
+
end)
|
|
538
|
+
|
|
539
|
+
true ->
|
|
540
|
+
baseval = U.getpath(base, path)
|
|
541
|
+
|
|
542
|
+
# The sentinels are tested BEFORE the identity check below.
|
|
543
|
+
# Otherwise a subject returning the literal string "__UNDEF__"
|
|
544
|
+
# satisfies an assertion that the key is absent - two mutually
|
|
545
|
+
# exclusive states passing one check. A sentinel that accepts its
|
|
546
|
+
# own literal is not a sentinel. (NULLMARK still accepts NULLMARK:
|
|
547
|
+
# under the default null flag a real null has already been
|
|
548
|
+
# normalised to it, so the two are genuinely indistinguishable
|
|
549
|
+
# here - that one needs a raw-value escape, not an ordering
|
|
550
|
+
# change.)
|
|
551
|
+
cond do
|
|
552
|
+
# Explicitly absent: satisfied only by a genuinely missing key,
|
|
553
|
+
# never by a present null (the distinction the sentinels keep).
|
|
554
|
+
U.undefmark() == check ->
|
|
555
|
+
if U.isabsent(baseval) do
|
|
556
|
+
:ok
|
|
557
|
+
else
|
|
558
|
+
raise fail(label, index, entry, "expected absent at #{where}",
|
|
559
|
+
"absent", U.stringify(baseval))
|
|
560
|
+
end
|
|
561
|
+
|
|
562
|
+
# Explicitly null: satisfied only by a present null.
|
|
563
|
+
U.nullmark() == check ->
|
|
564
|
+
if is_nil(baseval) or U.nullmark() == baseval do
|
|
565
|
+
:ok
|
|
566
|
+
else
|
|
567
|
+
raise fail(label, index, entry, "expected null at #{where}",
|
|
568
|
+
"null", U.stringify(baseval))
|
|
569
|
+
end
|
|
570
|
+
|
|
571
|
+
# Explicitly present: any present value, including null.
|
|
572
|
+
U.existsmark() == check ->
|
|
573
|
+
if not U.isabsent(baseval) do
|
|
574
|
+
:ok
|
|
575
|
+
else
|
|
576
|
+
raise fail(label, index, entry, "expected present at #{where}",
|
|
577
|
+
"present", "absent")
|
|
578
|
+
end
|
|
579
|
+
|
|
580
|
+
# Identical values match. This sits below the sentinel branches
|
|
581
|
+
# on purpose - see the note above.
|
|
582
|
+
U.deepequal(check, baseval) ->
|
|
583
|
+
:ok
|
|
584
|
+
|
|
585
|
+
# A concrete expectation never matches a missing key - a match
|
|
586
|
+
# leaf against an absent value must fail, not substring-match.
|
|
587
|
+
U.isabsent(baseval) ->
|
|
588
|
+
raise fail(label, index, entry, "match failed at #{where}",
|
|
589
|
+
U.stringify(check), "absent")
|
|
590
|
+
|
|
591
|
+
matchval(check, baseval) ->
|
|
592
|
+
:ok
|
|
593
|
+
|
|
594
|
+
true ->
|
|
595
|
+
raise fail(label, index, entry, "match failed at #{where}",
|
|
596
|
+
U.stringify(check), U.stringify(baseval))
|
|
597
|
+
end
|
|
598
|
+
end
|
|
599
|
+
end
|
|
600
|
+
|
|
601
|
+
# The spec-defined part of an entry (drop runner bookkeeping). A
|
|
602
|
+
# checkentry failure can hand this a non-map entry (e.g. "entry is not
|
|
603
|
+
# a map" itself) - pass those through unchanged rather than crash.
|
|
604
|
+
defp entrysummary(entry) do
|
|
605
|
+
if U.ismap(entry), do: Map.drop(entry, ["res", "thrown", "ctx"]), else: entry
|
|
606
|
+
end
|
|
607
|
+
|
|
608
|
+
# The label of one entry, for failure messages.
|
|
609
|
+
defp entryref(label, index, entry) do
|
|
610
|
+
id = U.get(entry, "id")
|
|
611
|
+
idpart = if U.isabsent(id), do: "", else: " (#{U.stringify(id)})"
|
|
612
|
+
"#{label}[#{index}]#{idpart}"
|
|
613
|
+
end
|
|
614
|
+
|
|
615
|
+
defp fail(label, index, entry, reason, expected, actual) do
|
|
616
|
+
message = "omni: #{entryref(label, index, entry)}: #{reason}"
|
|
617
|
+
message = if expected, do: message <> "\n expected: #{expected}", else: message
|
|
618
|
+
message = if actual, do: message <> "\n actual: #{actual}", else: message
|
|
619
|
+
message = message <> "\n entry: #{U.stringify(entrysummary(entry))}"
|
|
620
|
+
|
|
621
|
+
%OmniError{message: message, entry: entry}
|
|
622
|
+
end
|
|
623
|
+
end
|