stoobly-agent 1.10.0__py3-none-any.whl → 1.10.2__py3-none-any.whl
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.
- stoobly_agent/__init__.py +1 -1
- stoobly_agent/__main__.py +10 -0
- stoobly_agent/app/api/application_http_request_handler.py +5 -2
- stoobly_agent/app/cli/ca_cert_cli.py +9 -5
- stoobly_agent/app/cli/helpers/replay_facade.py +2 -2
- stoobly_agent/app/cli/intercept_cli.py +5 -5
- stoobly_agent/app/cli/request_cli.py +2 -2
- stoobly_agent/app/cli/scaffold/app.py +14 -5
- stoobly_agent/app/cli/scaffold/app_command.py +0 -4
- stoobly_agent/app/cli/scaffold/app_config.py +49 -2
- stoobly_agent/app/cli/scaffold/app_create_command.py +145 -76
- stoobly_agent/app/cli/scaffold/constants.py +9 -4
- stoobly_agent/app/cli/scaffold/docker/constants.py +3 -1
- stoobly_agent/app/cli/scaffold/docker/service/build_decorator.py +4 -4
- stoobly_agent/app/cli/scaffold/docker/service/builder.py +31 -54
- stoobly_agent/app/cli/scaffold/docker/service/configure_gateway.py +3 -0
- stoobly_agent/app/cli/scaffold/docker/template_files.py +112 -0
- stoobly_agent/app/cli/scaffold/docker/workflow/build_decorator.py +1 -1
- stoobly_agent/app/cli/scaffold/docker/workflow/builder.py +30 -47
- stoobly_agent/app/cli/scaffold/docker/workflow/command_decorator.py +3 -2
- stoobly_agent/app/cli/scaffold/docker/workflow/detached_decorator.py +1 -1
- stoobly_agent/app/cli/scaffold/docker/workflow/dns_decorator.py +2 -3
- stoobly_agent/app/cli/scaffold/docker/workflow/local_decorator.py +1 -1
- stoobly_agent/app/cli/scaffold/docker/workflow/mock_decorator.py +1 -1
- stoobly_agent/app/cli/scaffold/docker/workflow/reverse_proxy_decorator.py +1 -1
- stoobly_agent/app/cli/scaffold/docker/workflow/run_command.py +423 -0
- stoobly_agent/app/cli/scaffold/local/__init__.py +0 -0
- stoobly_agent/app/cli/scaffold/local/service/__init__.py +0 -0
- stoobly_agent/app/cli/scaffold/local/service/builder.py +72 -0
- stoobly_agent/app/cli/scaffold/local/workflow/__init__.py +0 -0
- stoobly_agent/app/cli/scaffold/local/workflow/builder.py +35 -0
- stoobly_agent/app/cli/scaffold/local/workflow/run_command.py +339 -0
- stoobly_agent/app/cli/scaffold/service_command.py +9 -1
- stoobly_agent/app/cli/scaffold/service_config.py +9 -25
- stoobly_agent/app/cli/scaffold/service_create_command.py +18 -6
- stoobly_agent/app/cli/scaffold/service_docker_compose.py +3 -3
- stoobly_agent/app/cli/scaffold/service_workflow_validate_command.py +10 -7
- stoobly_agent/app/cli/scaffold/templates/app/.Makefile +2 -2
- stoobly_agent/app/cli/scaffold/templates/app/build/.docker-compose.base.yml +4 -4
- stoobly_agent/app/cli/scaffold/templates/app/build/mock/configure +3 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/record/configure +28 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/test/configure +3 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/.docker-compose.base.yml +4 -4
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/configure +3 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/run +3 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/configure +3 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/run +3 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/configure +3 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/run +3 -0
- stoobly_agent/app/cli/scaffold/templates/build/services/build/mock/.configure +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/build/mock/.init +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/build/mock/.run +14 -0
- stoobly_agent/app/cli/scaffold/templates/build/services/build/record/.configure +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/build/record/.init +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/build/record/.run +14 -0
- stoobly_agent/app/cli/scaffold/templates/build/services/build/test/.configure +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/build/test/.init +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/build/test/.run +14 -0
- stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/mock/.configure +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/mock/.init +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/mock/.run +19 -0
- stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/record/.configure +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/record/.init +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/record/.run +19 -0
- stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/test/.configure +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/test/.init +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/test/.run +19 -0
- stoobly_agent/app/cli/scaffold/templates/build/workflows/exec/scaffold/.up +0 -1
- stoobly_agent/app/cli/scaffold/templates/build/workflows/mock/.configure +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/workflows/mock/.init +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/workflows/mock/.run +14 -0
- stoobly_agent/app/cli/scaffold/templates/build/workflows/record/.configure +25 -1
- stoobly_agent/app/cli/scaffold/templates/build/workflows/record/.init +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/workflows/record/.run +14 -0
- stoobly_agent/app/cli/scaffold/templates/build/workflows/test/.configure +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/workflows/test/.init +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/workflows/test/.run +14 -0
- stoobly_agent/app/cli/scaffold/templates/constants.py +35 -19
- stoobly_agent/app/cli/scaffold/templates/factory.py +34 -18
- stoobly_agent/app/cli/scaffold/templates/plugins/cypress/test/.run +21 -0
- stoobly_agent/app/cli/scaffold/templates/plugins/playwright/test/.run +21 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/mock/configure +5 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/mock/run +3 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/record/configure +21 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/record/run +3 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/test/configure +5 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/test/run +3 -0
- stoobly_agent/app/cli/scaffold/workflow_command.py +18 -4
- stoobly_agent/app/cli/scaffold/workflow_copy_command.py +5 -4
- stoobly_agent/app/cli/scaffold/workflow_create_command.py +31 -29
- stoobly_agent/app/cli/scaffold/workflow_run_command.py +18 -151
- stoobly_agent/app/cli/scaffold_cli.py +134 -182
- stoobly_agent/app/cli/scenario_cli.py +2 -2
- stoobly_agent/app/cli/types/test.py +2 -2
- stoobly_agent/app/cli/types/workflow_run_command.py +52 -3
- stoobly_agent/app/proxy/handle_mock_service.py +1 -1
- stoobly_agent/app/proxy/intercept_settings.py +6 -26
- stoobly_agent/app/proxy/mock/eval_fixtures_service.py +177 -27
- stoobly_agent/app/proxy/mock/types/__init__.py +22 -1
- stoobly_agent/app/proxy/record/upload_request_service.py +3 -6
- stoobly_agent/app/proxy/replay/body_parser_service.py +8 -5
- stoobly_agent/app/proxy/replay/multipart.py +15 -13
- stoobly_agent/app/proxy/replay/replay_request_service.py +2 -2
- stoobly_agent/app/proxy/run.py +3 -0
- stoobly_agent/app/proxy/test/context.py +0 -4
- stoobly_agent/app/proxy/test/context_abc.py +0 -5
- stoobly_agent/app/proxy/utils/publish_change_service.py +20 -23
- stoobly_agent/app/settings/__init__.py +10 -7
- stoobly_agent/cli.py +61 -16
- stoobly_agent/config/data_dir.py +1 -8
- stoobly_agent/public/12-es2015.618ecfd5f735b801b50f.js +1 -0
- stoobly_agent/public/12-es5.618ecfd5f735b801b50f.js +1 -0
- stoobly_agent/public/index.html +1 -1
- stoobly_agent/public/main-es2015.5a9aa16433404c3f423a.js +1 -0
- stoobly_agent/public/main-es5.5a9aa16433404c3f423a.js +1 -0
- stoobly_agent/public/runtime-es2015.77bcd31efed9e5d5d431.js +1 -0
- stoobly_agent/public/runtime-es5.77bcd31efed9e5d5d431.js +1 -0
- stoobly_agent/test/app/cli/intercept/intercept_configure_test.py +17 -6
- stoobly_agent/test/app/cli/scaffold/docker/cli_invoker.py +177 -0
- stoobly_agent/test/app/cli/scaffold/{cli_test.py → docker/cli_test.py} +4 -11
- stoobly_agent/test/app/cli/scaffold/{e2e_test.py → docker/e2e_test.py} +42 -27
- stoobly_agent/test/app/cli/scaffold/local/__init__.py +0 -0
- stoobly_agent/test/app/cli/scaffold/{cli_invoker.py → local/cli_invoker.py} +38 -32
- stoobly_agent/test/app/cli/scaffold/local/e2e_test.py +342 -0
- stoobly_agent/test/app/models/schemas/.stoobly/db/VERSION +1 -1
- stoobly_agent/test/app/proxy/mock/eval_fixtures_service_test.py +903 -2
- stoobly_agent/test/app/proxy/replay/body_parser_service_test.py +95 -3
- stoobly_agent/test/config/data_dir_test.py +2 -7
- stoobly_agent/test/test_helper.py +16 -5
- {stoobly_agent-1.10.0.dist-info → stoobly_agent-1.10.2.dist-info}/METADATA +4 -2
- {stoobly_agent-1.10.0.dist-info → stoobly_agent-1.10.2.dist-info}/RECORD +157 -129
- {stoobly_agent-1.10.0.dist-info → stoobly_agent-1.10.2.dist-info}/WHEEL +1 -1
- stoobly_agent/app/cli/helpers/shell.py +0 -26
- stoobly_agent/app/cli/scaffold/templates/app/build/mock/bin/configure +0 -3
- stoobly_agent/app/cli/scaffold/templates/app/build/record/bin/configure +0 -3
- stoobly_agent/app/cli/scaffold/templates/app/build/test/bin/configure +0 -3
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/bin/configure +0 -3
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/bin/configure +0 -3
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/bin/configure +0 -3
- stoobly_agent/app/cli/scaffold/templates/workflow/mock/bin/configure +0 -13
- stoobly_agent/app/cli/scaffold/templates/workflow/record/bin/configure +0 -47
- stoobly_agent/app/cli/scaffold/templates/workflow/test/bin/configure +0 -13
- stoobly_agent/public/12-es2015.be58ed0ef449008b932e.js +0 -1
- stoobly_agent/public/12-es5.be58ed0ef449008b932e.js +0 -1
- stoobly_agent/public/main-es2015.089b46f303768fbe864f.js +0 -1
- stoobly_agent/public/main-es5.089b46f303768fbe864f.js +0 -1
- stoobly_agent/public/runtime-es2015.f8c814b38b27708e91c1.js +0 -1
- stoobly_agent/public/runtime-es5.f8c814b38b27708e91c1.js +0 -1
- /stoobly_agent/app/cli/scaffold/templates/app/build/mock/{.docker-compose.mock.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/build/mock/{bin/init → init} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/build/record/{.docker-compose.record.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/build/record/{bin/init → init} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/build/test/{.docker-compose.test.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/build/test/{bin/init → init} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/{.docker-compose.mock.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/{bin/init → init} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/{.docker-compose.record.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/{bin/init → init} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/{.docker-compose.test.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/{bin/init → init} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/gateway/mock/{.docker-compose.mock.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/gateway/record/{.docker-compose.record.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/gateway/test/{.docker-compose.test.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/{.docker-compose.exec.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/mock/{.docker-compose.mock.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/record/{.docker-compose.record.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/plugins/cypress/test/{.docker-compose.test.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/plugins/playwright/test/{.docker-compose.test.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/workflow/mock/{bin/init → init} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/workflow/record/{bin/init → init} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/workflow/test/{bin/init → init} +0 -0
- {stoobly_agent-1.10.0.dist-info → stoobly_agent-1.10.2.dist-info}/entry_points.txt +0 -0
- {stoobly_agent-1.10.0.dist-info → stoobly_agent-1.10.2.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
!function(e){function r(r){for(var t,n,o=r[0],d=r[1],b=r[2],i=0,l=[];i<o.length;i++)n=o[i],Object.prototype.hasOwnProperty.call(c,n)&&c[n]&&l.push(c[n][0]),c[n]=0;for(t in d)Object.prototype.hasOwnProperty.call(d,t)&&(e[t]=d[t]);for(u&&u(r);l.length;)l.shift()();return f.push.apply(f,b||[]),a()}function a(){for(var e,r=0;r<f.length;r++){for(var a=f[r],t=!0,o=1;o<a.length;o++)0!==c[a[o]]&&(t=!1);t&&(f.splice(r--,1),e=n(n.s=a[0]))}return e}var t={},c={11:0},f=[];function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.e=function(e){var r=[],a=c[e];if(0!==a)if(a)r.push(a[2]);else{var t=new Promise(function(r,t){a=c[e]=[r,t]});r.push(a[2]=t);var f,o=document.createElement("script");o.charset="utf-8",o.timeout=120,n.nc&&o.setAttribute("nonce",n.nc),o.src=function(e){return n.p+""+({3:"common"}[e]||e)+"-es2015."+{0:"c7c5a6d51b98cb85b9fc",1:"bb4492eeabe1fe937ada",2:"51eb8544ea9a21f2874c",3:"388805227aa99c527fba",4:"f8ac5475bf103969b2d2",5:"90ea7bd4439d9749e052",6:"5fb726c0555664300974",7:"ba9f789e186a8e3962d3",8:"b901639e2aeff1358c3d",9:"1d75413af5d96b4ff1e5",10:"56da22458086513ba0c7",12:"618ecfd5f735b801b50f",13:"6d3a4fd76d46bfa5f200",14:"b6619d7742671d2a37fb",15:"d8855701408b0e1d7a3e",16:"98fa59c2c96d2caac3c3",17:"7f60b56d1fd66d4d5544",18:"beb31fe4a4dee3007cb2",19:"e5acb2c1e0e91717efc2",20:"90544c488f1f0900bab4",21:"63ed4e6b242fbc047bd6",22:"1e96ef651f96d51191e2",23:"6d3052555b4fac38f16d",28:"a2bf42f38e4dd771ccea",29:"18b515f07c88753c7eb6",30:"d4d3dc4101400cadf3f3",31:"e3ea815f75c19c217b7d",32:"57553995bff0ae518501",33:"da5ba1e5baa164921198",34:"87acbb95cfb824650157",35:"4ffe6f7a196ed1a87fc7",36:"e3a104020eeec02cb8c4",37:"3b472e6cf303201bbf2c",38:"39dbf43d46cdc94f78c6",39:"e5475ea4fb6ec5c60741",40:"47b2873a8439717af6a7",41:"69f2771002745c066976",42:"b590b92ede890155dcd6",43:"ad1d956bffba561ba64c",44:"3ef2c17996ed5be95ced",45:"3d65d27e0a7085e96356",46:"e4f0a5b127eae13c27c0",47:"c7d45334a70131f133b5"}[e]+".js"}(e);var d=new Error;f=function(r){o.onerror=o.onload=null,clearTimeout(b);var a=c[e];if(0!==a){if(a){var t=r&&("load"===r.type?"missing":r.type),f=r&&r.target&&r.target.src;d.message="Loading chunk "+e+" failed.\n("+t+": "+f+")",d.name="ChunkLoadError",d.type=t,d.request=f,a[1](d)}c[e]=void 0}};var b=setTimeout(function(){f({type:"timeout",target:o})},12e4);o.onerror=o.onload=f,document.head.appendChild(o)}return Promise.all(r)},n.m=e,n.c=t,n.d=function(e,r,a){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var t in e)n.d(a,t,(function(r){return e[r]}).bind(null,t));return a},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n.oe=function(e){throw console.error(e),e};var o=window.webpackJsonp=window.webpackJsonp||[],d=o.push.bind(o);o.push=r,o=o.slice();for(var b=0;b<o.length;b++)r(o[b]);var u=d;a()}([]);
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(e){function r(r){for(var t,n,o=r[0],d=r[1],b=r[2],i=0,l=[];i<o.length;i++)n=o[i],Object.prototype.hasOwnProperty.call(c,n)&&c[n]&&l.push(c[n][0]),c[n]=0;for(t in d)Object.prototype.hasOwnProperty.call(d,t)&&(e[t]=d[t]);for(u&&u(r);l.length;)l.shift()();return f.push.apply(f,b||[]),a()}function a(){for(var e,r=0;r<f.length;r++){for(var a=f[r],t=!0,o=1;o<a.length;o++)0!==c[a[o]]&&(t=!1);t&&(f.splice(r--,1),e=n(n.s=a[0]))}return e}var t={},c={11:0},f=[];function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.e=function(e){var r=[],a=c[e];if(0!==a)if(a)r.push(a[2]);else{var t=new Promise(function(r,t){a=c[e]=[r,t]});r.push(a[2]=t);var f,o=document.createElement("script");o.charset="utf-8",o.timeout=120,n.nc&&o.setAttribute("nonce",n.nc),o.src=function(e){return n.p+""+({3:"common"}[e]||e)+"-es5."+{0:"c7c5a6d51b98cb85b9fc",1:"bb4492eeabe1fe937ada",2:"51eb8544ea9a21f2874c",3:"388805227aa99c527fba",4:"f8ac5475bf103969b2d2",5:"90ea7bd4439d9749e052",6:"5fb726c0555664300974",7:"ba9f789e186a8e3962d3",8:"b901639e2aeff1358c3d",9:"1d75413af5d96b4ff1e5",10:"56da22458086513ba0c7",12:"618ecfd5f735b801b50f",13:"6d3a4fd76d46bfa5f200",14:"b6619d7742671d2a37fb",15:"d8855701408b0e1d7a3e",16:"98fa59c2c96d2caac3c3",17:"7f60b56d1fd66d4d5544",18:"beb31fe4a4dee3007cb2",19:"e5acb2c1e0e91717efc2",20:"90544c488f1f0900bab4",21:"63ed4e6b242fbc047bd6",22:"1e96ef651f96d51191e2",23:"6d3052555b4fac38f16d",28:"a2bf42f38e4dd771ccea",29:"18b515f07c88753c7eb6",30:"d4d3dc4101400cadf3f3",31:"e3ea815f75c19c217b7d",32:"57553995bff0ae518501",33:"da5ba1e5baa164921198",34:"87acbb95cfb824650157",35:"4ffe6f7a196ed1a87fc7",36:"e3a104020eeec02cb8c4",37:"3b472e6cf303201bbf2c",38:"39dbf43d46cdc94f78c6",39:"e5475ea4fb6ec5c60741",40:"47b2873a8439717af6a7",41:"69f2771002745c066976",42:"b590b92ede890155dcd6",43:"ad1d956bffba561ba64c",44:"3ef2c17996ed5be95ced",45:"3d65d27e0a7085e96356",46:"e4f0a5b127eae13c27c0",47:"c7d45334a70131f133b5"}[e]+".js"}(e);var d=new Error;f=function(r){o.onerror=o.onload=null,clearTimeout(b);var a=c[e];if(0!==a){if(a){var t=r&&("load"===r.type?"missing":r.type),f=r&&r.target&&r.target.src;d.message="Loading chunk "+e+" failed.\n("+t+": "+f+")",d.name="ChunkLoadError",d.type=t,d.request=f,a[1](d)}c[e]=void 0}};var b=setTimeout(function(){f({type:"timeout",target:o})},12e4);o.onerror=o.onload=f,document.head.appendChild(o)}return Promise.all(r)},n.m=e,n.c=t,n.d=function(e,r,a){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var t in e)n.d(a,t,(function(r){return e[r]}).bind(null,t));return a},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n.oe=function(e){throw console.error(e),e};var o=window.webpackJsonp=window.webpackJsonp||[],d=o.push.bind(o);o.push=r,o=o.slice();for(var b=0;b<o.length;b++)r(o[b]);var u=d;a()}([]);
|
@@ -1,8 +1,12 @@
|
|
1
|
+
import importlib
|
2
|
+
import os
|
1
3
|
import pdb
|
4
|
+
from click import Group
|
2
5
|
import pytest
|
3
6
|
|
4
7
|
from click.testing import CliRunner
|
5
8
|
|
9
|
+
from stoobly_agent.app.cli import intercept_cli
|
6
10
|
from stoobly_agent.test.test_helper import reset
|
7
11
|
|
8
12
|
from stoobly_agent.cli import config, intercept, scenario
|
@@ -10,7 +14,7 @@ from stoobly_agent.lib.orm.scenario import Scenario
|
|
10
14
|
from stoobly_agent.app.settings import Settings
|
11
15
|
from stoobly_agent.lib.api.keys.project_key import ProjectKey
|
12
16
|
|
13
|
-
from stoobly_agent.config.constants import mode, mock_policy, record_order, record_policy, record_strategy, replay_policy, test_strategy
|
17
|
+
from stoobly_agent.config.constants import env_vars, mode, mock_policy, record_order, record_policy, record_strategy, replay_policy, test_strategy
|
14
18
|
|
15
19
|
@pytest.fixture(scope='module')
|
16
20
|
def runner():
|
@@ -20,6 +24,14 @@ def runner():
|
|
20
24
|
def settings():
|
21
25
|
return reset()
|
22
26
|
|
27
|
+
@pytest.fixture(scope='module')
|
28
|
+
def intercept_cli():
|
29
|
+
from stoobly_agent.app.cli import intercept_cli as _intercept_cli
|
30
|
+
os.environ[env_vars.AGENT_REMOTE_ENABLED] = '1'
|
31
|
+
importlib.reload(_intercept_cli)
|
32
|
+
del os.environ[env_vars.AGENT_REMOTE_ENABLED]
|
33
|
+
return _intercept_cli.intercept
|
34
|
+
|
23
35
|
class TestInterceptConfigure():
|
24
36
|
|
25
37
|
class TestRecordOrder():
|
@@ -156,9 +168,8 @@ class TestInterceptConfigure():
|
|
156
168
|
assert data_rule.replay_policy == replay_policy.ALL
|
157
169
|
|
158
170
|
class TestTestPolicy():
|
159
|
-
|
160
|
-
|
161
|
-
configure_result = runner.invoke(intercept, ['configure', '--mode', mode.TEST, '--policy', mock_policy.FOUND])
|
171
|
+
def test_policy_test_mode_found(self, runner: CliRunner, intercept_cli: Group):
|
172
|
+
configure_result = runner.invoke(intercept_cli, ['configure', '--mode', mode.TEST, '--policy', mock_policy.FOUND])
|
162
173
|
assert configure_result.exit_code == 0
|
163
174
|
|
164
175
|
settings = Settings.instance()
|
@@ -196,9 +207,9 @@ class TestInterceptConfigure():
|
|
196
207
|
assert configure_result.exit_code == 1
|
197
208
|
assert "Error: Valid policies for" in configure_result.output
|
198
209
|
|
199
|
-
def test_policy_invalid_for_test_mode(self, runner: CliRunner):
|
210
|
+
def test_policy_invalid_for_test_mode(self, runner: CliRunner, intercept_cli: Group):
|
200
211
|
# Use record_policy.API which is not valid for TEST mode
|
201
|
-
configure_result = runner.invoke(
|
212
|
+
configure_result = runner.invoke(intercept_cli, ['configure', '--mode', mode.TEST, '--policy', record_policy.API])
|
202
213
|
assert configure_result.exit_code == 1
|
203
214
|
assert "Error: Valid policies for" in configure_result.output
|
204
215
|
|
@@ -0,0 +1,177 @@
|
|
1
|
+
import os
|
2
|
+
import pathlib
|
3
|
+
import pdb
|
4
|
+
import subprocess
|
5
|
+
|
6
|
+
from click.testing import CliRunner
|
7
|
+
|
8
|
+
from stoobly_agent.app.cli import scaffold
|
9
|
+
from stoobly_agent.config.data_dir import DATA_DIR_NAME
|
10
|
+
|
11
|
+
|
12
|
+
class ScaffoldCliInvoker():
|
13
|
+
|
14
|
+
@staticmethod
|
15
|
+
def cli_app_create(runner: CliRunner, app_dir_path: str, app_name: str):
|
16
|
+
pathlib.Path(f"{app_dir_path}/{DATA_DIR_NAME}").mkdir(parents=True, exist_ok=True)
|
17
|
+
|
18
|
+
result = runner.invoke(scaffold, ['app', 'create',
|
19
|
+
'--app-dir-path', app_dir_path,
|
20
|
+
'--quiet',
|
21
|
+
app_name
|
22
|
+
])
|
23
|
+
|
24
|
+
if result.exit_code != 0:
|
25
|
+
print(f"Command failed with exit code {result.exit_code}")
|
26
|
+
print(f"Output: {result.output}")
|
27
|
+
print(f"Exception: {result.exception}")
|
28
|
+
|
29
|
+
assert result.exit_code == 0
|
30
|
+
output = result.stdout
|
31
|
+
assert not output
|
32
|
+
|
33
|
+
@staticmethod
|
34
|
+
def cli_app_mkcert(runner: CliRunner, app_dir_path: str):
|
35
|
+
result = runner.invoke(scaffold, ['app', 'mkcert',
|
36
|
+
'--app-dir-path', app_dir_path,
|
37
|
+
'--context-dir-path', app_dir_path,
|
38
|
+
])
|
39
|
+
|
40
|
+
assert result.exit_code == 0
|
41
|
+
output = result.stdout
|
42
|
+
assert not output
|
43
|
+
|
44
|
+
@staticmethod
|
45
|
+
def cli_service_create(runner: CliRunner, app_dir_path: str, hostname: str, service_name: str, https: bool):
|
46
|
+
scheme = 'http'
|
47
|
+
port = '80'
|
48
|
+
if https == True:
|
49
|
+
scheme = 'https'
|
50
|
+
port = '443'
|
51
|
+
|
52
|
+
result = runner.invoke(scaffold, ['service', 'create',
|
53
|
+
'--app-dir-path', app_dir_path,
|
54
|
+
'--env', 'TEST',
|
55
|
+
'--hostname', hostname,
|
56
|
+
'--scheme', scheme,
|
57
|
+
'--port', port,
|
58
|
+
'--quiet',
|
59
|
+
'--workflow', 'mock',
|
60
|
+
'--workflow', 'record',
|
61
|
+
'--workflow', 'test',
|
62
|
+
service_name
|
63
|
+
])
|
64
|
+
assert result.exit_code == 0
|
65
|
+
output = result.stdout
|
66
|
+
assert not output
|
67
|
+
|
68
|
+
# Specific flags for assets
|
69
|
+
@staticmethod
|
70
|
+
def cli_service_create_assets(runner: CliRunner, app_dir_path: str, hostname: str, service_name: str, https: bool):
|
71
|
+
scheme = 'http'
|
72
|
+
port = '80'
|
73
|
+
if https == True:
|
74
|
+
scheme = 'https'
|
75
|
+
port = '443'
|
76
|
+
|
77
|
+
result = runner.invoke(scaffold, ['service', 'create',
|
78
|
+
'--app-dir-path', app_dir_path,
|
79
|
+
'--hostname', hostname,
|
80
|
+
'--scheme', scheme,
|
81
|
+
'--port', port,
|
82
|
+
'--upstream-hostname', hostname,
|
83
|
+
'--upstream-port', 80,
|
84
|
+
'--upstream-scheme', 'http',
|
85
|
+
'--detached',
|
86
|
+
'--quiet',
|
87
|
+
'--workflow', 'test',
|
88
|
+
service_name
|
89
|
+
])
|
90
|
+
assert result.exit_code == 0
|
91
|
+
output = result.stdout
|
92
|
+
assert not output
|
93
|
+
|
94
|
+
@staticmethod
|
95
|
+
def cli_service_delete(runner: CliRunner, app_dir_path: str, service_name: str):
|
96
|
+
result = runner.invoke(scaffold, ['service', 'delete',
|
97
|
+
'--app-dir-path', app_dir_path,
|
98
|
+
service_name
|
99
|
+
])
|
100
|
+
assert result.exit_code == 0
|
101
|
+
output = result.stdout
|
102
|
+
assert 'error' not in output.lower()
|
103
|
+
|
104
|
+
@staticmethod
|
105
|
+
def cli_workflow_create(runner: CliRunner, app_dir_path: str, service_name: str):
|
106
|
+
result = runner.invoke(scaffold, ['workflow', 'create',
|
107
|
+
'--app-dir-path', app_dir_path,
|
108
|
+
'--service', service_name,
|
109
|
+
'--template', 'mock',
|
110
|
+
'ci',
|
111
|
+
])
|
112
|
+
|
113
|
+
assert result.exit_code == 0
|
114
|
+
|
115
|
+
@staticmethod
|
116
|
+
def cli_workflow_up(runner: CliRunner, app_dir_path: str, target_workflow_name: str):
|
117
|
+
command = ['workflow', 'up',
|
118
|
+
'--app-dir-path', app_dir_path,
|
119
|
+
'--context-dir-path', app_dir_path,
|
120
|
+
'--yes',
|
121
|
+
target_workflow_name,
|
122
|
+
]
|
123
|
+
result = runner.invoke(scaffold, command)
|
124
|
+
|
125
|
+
if result.exit_code != 0:
|
126
|
+
print(f"Command failed with exit code {result.exit_code}")
|
127
|
+
print(f"Output: {result.output}")
|
128
|
+
print(f"Exception: {result.exception}")
|
129
|
+
|
130
|
+
assert result.exit_code == 0
|
131
|
+
|
132
|
+
@staticmethod
|
133
|
+
def cli_workflow_down(runner: CliRunner, app_dir_path: str, target_workflow_name: str):
|
134
|
+
command = ['workflow', 'down',
|
135
|
+
'--app-dir-path', app_dir_path,
|
136
|
+
'--context-dir-path', app_dir_path,
|
137
|
+
target_workflow_name,
|
138
|
+
]
|
139
|
+
result = runner.invoke(scaffold, command)
|
140
|
+
|
141
|
+
if result.exit_code != 0:
|
142
|
+
print(f"Down command failed with exit code {result.exit_code}")
|
143
|
+
print(f"Output: {result.output}")
|
144
|
+
print(f"Exception: {result.exception}")
|
145
|
+
|
146
|
+
assert result.exit_code == 0
|
147
|
+
|
148
|
+
@staticmethod
|
149
|
+
def makefile_workflow_up(runner: CliRunner, app_dir_path: str, target_workflow_name: str):
|
150
|
+
command = ['make', '-f', os.path.join(app_dir_path, '.stoobly', 'services', 'Makefile'),
|
151
|
+
target_workflow_name,
|
152
|
+
]
|
153
|
+
|
154
|
+
# Run the command using subprocess
|
155
|
+
# Instead of piping, print to stdout and stderr
|
156
|
+
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
157
|
+
|
158
|
+
if result.returncode != 0:
|
159
|
+
print(f"Command failed with exit code {result.returncode}")
|
160
|
+
print(f"Output: {result.stdout}")
|
161
|
+
print(f"Exception: {result.stderr}")
|
162
|
+
|
163
|
+
assert result.returncode == 0
|
164
|
+
|
165
|
+
@staticmethod
|
166
|
+
def makefile_workflow_down(runner: CliRunner, app_dir_path: str, target_workflow_name: str):
|
167
|
+
command = ['make', '-f', os.path.join(app_dir_path, '.stoobly', 'services', 'Makefile'),
|
168
|
+
f"{target_workflow_name}/down"
|
169
|
+
]
|
170
|
+
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
171
|
+
|
172
|
+
if result.returncode != 0:
|
173
|
+
print(f"Command failed with exit code {result.returncode}")
|
174
|
+
print(f"Output: {result.stdout}")
|
175
|
+
print(f"Exception: {result.stderr}")
|
176
|
+
|
177
|
+
assert result.returncode == 0
|
@@ -7,12 +7,12 @@ import pytest
|
|
7
7
|
|
8
8
|
from stoobly_agent.app.cli.scaffold.app import App
|
9
9
|
from stoobly_agent.app.cli.scaffold.constants import (
|
10
|
-
|
10
|
+
SERVICES_NAMESPACE,
|
11
11
|
WORKFLOW_RECORD_TYPE,
|
12
12
|
)
|
13
13
|
from stoobly_agent.app.cli.scaffold.service_docker_compose import ServiceDockerCompose
|
14
14
|
from stoobly_agent.config.data_dir import DataDir
|
15
|
-
from stoobly_agent.test.app.cli.scaffold.e2e_test import ScaffoldCliInvoker
|
15
|
+
from stoobly_agent.test.app.cli.scaffold.docker.e2e_test import ScaffoldCliInvoker
|
16
16
|
from stoobly_agent.test.test_helper import reset
|
17
17
|
|
18
18
|
|
@@ -81,16 +81,9 @@ class TestScaffoldCli():
|
|
81
81
|
|
82
82
|
# Generate certs
|
83
83
|
ScaffoldCliInvoker.cli_app_mkcert(runner, app_dir_path)
|
84
|
-
|
85
|
-
@pytest.fixture(scope="class", autouse=True)
|
86
|
-
def cleanup_after_all(self, runner, app_dir_path, target_workflow_name):
|
87
|
-
yield
|
88
|
-
ScaffoldCliInvoker.cli_workflow_down(runner, app_dir_path, target_workflow_name)
|
89
|
-
shutil.rmtree(app_dir_path)
|
90
|
-
|
91
84
|
|
92
85
|
def test_service_delete(self, runner, app_dir_path, external_service_docker_compose):
|
93
|
-
app = App(app_dir_path,
|
86
|
+
app = App(app_dir_path, SERVICES_NAMESPACE)
|
94
87
|
service_name = external_service_docker_compose.service_name
|
95
88
|
|
96
89
|
ScaffoldCliInvoker.cli_service_delete(runner, app_dir_path, service_name)
|
@@ -105,7 +98,7 @@ class TestScaffoldCli():
|
|
105
98
|
assert False
|
106
99
|
|
107
100
|
def test_service_delete_https(self, runner, app_dir_path, external_https_service_docker_compose):
|
108
|
-
app = App(app_dir_path,
|
101
|
+
app = App(app_dir_path, SERVICES_NAMESPACE)
|
109
102
|
service_name = external_https_service_docker_compose.service_name
|
110
103
|
hostname = external_https_service_docker_compose.hostname
|
111
104
|
|
@@ -1,13 +1,13 @@
|
|
1
|
-
from pathlib import Path
|
2
1
|
import pdb
|
2
|
+
import pytest
|
3
3
|
import shutil
|
4
4
|
|
5
5
|
from click.testing import CliRunner
|
6
|
-
import
|
6
|
+
from pathlib import Path
|
7
7
|
|
8
8
|
from stoobly_agent.app.cli.scaffold.app import App
|
9
9
|
from stoobly_agent.app.cli.scaffold.constants import (
|
10
|
-
|
10
|
+
SERVICES_NAMESPACE,
|
11
11
|
WORKFLOW_RECORD_TYPE,
|
12
12
|
WORKFLOW_TEST_TYPE,
|
13
13
|
)
|
@@ -22,10 +22,9 @@ from stoobly_agent.app.cli.scaffold.workflow_validate_command import (
|
|
22
22
|
WorkflowValidateCommand,
|
23
23
|
)
|
24
24
|
from stoobly_agent.config.data_dir import DataDir
|
25
|
-
from stoobly_agent.test.app.cli.scaffold.cli_invoker import ScaffoldCliInvoker
|
25
|
+
from stoobly_agent.test.app.cli.scaffold.docker.cli_invoker import ScaffoldCliInvoker
|
26
26
|
from stoobly_agent.test.test_helper import reset
|
27
27
|
|
28
|
-
|
29
28
|
@pytest.mark.e2e
|
30
29
|
class TestScaffoldE2e():
|
31
30
|
|
@@ -49,12 +48,12 @@ class TestScaffoldE2e():
|
|
49
48
|
yield tmp_path
|
50
49
|
|
51
50
|
@pytest.fixture(scope='class', autouse=True)
|
52
|
-
def app_dir_path(self, temp_dir
|
51
|
+
def app_dir_path(self, temp_dir):
|
53
52
|
yield temp_dir
|
54
53
|
|
55
54
|
@pytest.fixture(scope='class')
|
56
55
|
def mock_data_directory_path(self):
|
57
|
-
yield Path(__file__).parent.parent.parent.parent / 'mock_data'
|
56
|
+
yield Path(__file__).parent.parent.parent.parent.parent / 'mock_data'
|
58
57
|
|
59
58
|
@pytest.fixture(scope='class')
|
60
59
|
def local_service_mock_docker_compose_path(self, mock_data_directory_path):
|
@@ -85,7 +84,6 @@ class TestScaffoldE2e():
|
|
85
84
|
def local_service_name(self):
|
86
85
|
yield "my-httpbin"
|
87
86
|
|
88
|
-
|
89
87
|
class TestRecordWorkflow():
|
90
88
|
@pytest.fixture(scope='class', autouse=True)
|
91
89
|
def target_workflow_name(self):
|
@@ -135,10 +133,9 @@ class TestScaffoldE2e():
|
|
135
133
|
def cleanup_after_all(self, runner, app_dir_path, target_workflow_name):
|
136
134
|
yield
|
137
135
|
ScaffoldCliInvoker.cli_workflow_down(runner, app_dir_path, target_workflow_name)
|
138
|
-
shutil.rmtree(app_dir_path)
|
139
136
|
|
140
137
|
def test_core_services(self, app_dir_path, target_workflow_name):
|
141
|
-
app = App(app_dir_path,
|
138
|
+
app = App(app_dir_path, SERVICES_NAMESPACE)
|
142
139
|
config = {
|
143
140
|
'workflow_name': target_workflow_name,
|
144
141
|
'service_name': 'build'
|
@@ -148,7 +145,7 @@ class TestScaffoldE2e():
|
|
148
145
|
command.validate()
|
149
146
|
|
150
147
|
def test_external_service(self, external_service_docker_compose: ServiceDockerCompose, app_dir_path, target_workflow_name):
|
151
|
-
app = App(app_dir_path,
|
148
|
+
app = App(app_dir_path, SERVICES_NAMESPACE)
|
152
149
|
config = {
|
153
150
|
'workflow_name': target_workflow_name,
|
154
151
|
'service_name': external_service_docker_compose.service_name
|
@@ -158,7 +155,7 @@ class TestScaffoldE2e():
|
|
158
155
|
command.validate()
|
159
156
|
|
160
157
|
def test_local_service(self, app_dir_path, target_workflow_name, local_service_docker_compose: ServiceDockerCompose):
|
161
|
-
app = App(app_dir_path,
|
158
|
+
app = App(app_dir_path, SERVICES_NAMESPACE)
|
162
159
|
config = {
|
163
160
|
'workflow_name': target_workflow_name,
|
164
161
|
'service_name': local_service_docker_compose.service_name
|
@@ -197,15 +194,21 @@ class TestScaffoldE2e():
|
|
197
194
|
|
198
195
|
@pytest.fixture(scope='class')
|
199
196
|
def external_service_docker_compose(self, app_dir_path, target_workflow_name, external_service_name, hostname):
|
200
|
-
yield ServiceDockerCompose(
|
197
|
+
yield ServiceDockerCompose(
|
198
|
+
app_dir_path=app_dir_path, target_workflow_name=target_workflow_name, service_name=external_service_name, hostname=hostname
|
199
|
+
)
|
201
200
|
|
202
201
|
@pytest.fixture(scope='class')
|
203
202
|
def local_service_docker_compose(self, app_dir_path, target_workflow_name, local_service_name, local_hostname):
|
204
|
-
yield ServiceDockerCompose(
|
203
|
+
yield ServiceDockerCompose(
|
204
|
+
app_dir_path=app_dir_path, target_workflow_name=target_workflow_name, service_name=local_service_name, hostname=local_hostname
|
205
|
+
)
|
205
206
|
|
206
207
|
@pytest.fixture(scope='class')
|
207
208
|
def assets_service_docker_compose(self, app_dir_path, target_workflow_name, assets_service_name, assets_hostname):
|
208
|
-
yield ServiceDockerCompose(
|
209
|
+
yield ServiceDockerCompose(
|
210
|
+
app_dir_path=app_dir_path, target_workflow_name=target_workflow_name, service_name=assets_service_name, hostname=assets_hostname
|
211
|
+
)
|
209
212
|
|
210
213
|
@pytest.fixture(scope='class', autouse=True)
|
211
214
|
def setup_docker_composes(self, managed_services_docker_compose, external_service_docker_compose, local_service_docker_compose, assets_service_docker_compose):
|
@@ -215,7 +218,7 @@ class TestScaffoldE2e():
|
|
215
218
|
self.assets_service_docker_compose = assets_service_docker_compose
|
216
219
|
|
217
220
|
@pytest.fixture(scope="class", autouse=True)
|
218
|
-
def create_scaffold_setup(self, runner, app_name, app_dir_path, target_workflow_name, external_service_docker_compose, local_service_docker_compose, assets_service_docker_compose, mock_data_directory_path, assets_service_mock_docker_compose_path):
|
221
|
+
def create_scaffold_setup(self, runner, app_name, app_dir_path, target_workflow_name, external_service_docker_compose, local_service_docker_compose, assets_service_docker_compose, mock_data_directory_path, assets_service_mock_docker_compose_path, workflow_up_method: str):
|
219
222
|
|
220
223
|
ScaffoldCliInvoker.cli_app_create(runner, app_dir_path, app_name)
|
221
224
|
|
@@ -223,7 +226,7 @@ class TestScaffoldE2e():
|
|
223
226
|
ScaffoldCliInvoker.cli_service_create(runner, app_dir_path, external_service_docker_compose.hostname, external_service_docker_compose.service_name, False)
|
224
227
|
# Create local user defined services
|
225
228
|
ScaffoldCliInvoker.cli_service_create(runner, app_dir_path, local_service_docker_compose.hostname, local_service_docker_compose.service_name, False)
|
226
|
-
ScaffoldCliInvoker.cli_service_create_assets(runner, app_dir_path, assets_service_docker_compose.hostname, assets_service_docker_compose.service_name,
|
229
|
+
ScaffoldCliInvoker.cli_service_create_assets(runner, app_dir_path, assets_service_docker_compose.hostname, assets_service_docker_compose.service_name, True)
|
227
230
|
|
228
231
|
# Don't run the local user defined service in the 'test' workflow
|
229
232
|
# So don't copy the Docker Compose file over
|
@@ -233,17 +236,17 @@ class TestScaffoldE2e():
|
|
233
236
|
assert destination_path.is_file()
|
234
237
|
shutil.copyfile(assets_service_mock_docker_compose_path, destination_path)
|
235
238
|
|
236
|
-
ScaffoldCliInvoker.cli_service_create_assets(runner, app_dir_path, assets_service_docker_compose.hostname, assets_service_docker_compose.service_name,
|
239
|
+
ScaffoldCliInvoker.cli_service_create_assets(runner, app_dir_path, assets_service_docker_compose.hostname, assets_service_docker_compose.service_name, True)
|
237
240
|
|
238
241
|
# Add assets for assets service
|
239
242
|
data_dir_path = DataDir.instance().path
|
240
|
-
destination_assets_path = f"{data_dir_path}/
|
243
|
+
destination_assets_path = f"{data_dir_path}/{SERVICES_NAMESPACE}/{assets_service_docker_compose.service_name}/{target_workflow_name}/index.html"
|
241
244
|
destination_path = Path(destination_assets_path)
|
242
245
|
assets_mock_path = mock_data_directory_path / "scaffold" / "index.html"
|
243
246
|
shutil.copyfile(assets_mock_path, destination_path)
|
244
247
|
|
245
248
|
# Created shared file in fixtures folder
|
246
|
-
app = App(app_dir_path,
|
249
|
+
app = App(app_dir_path, SERVICES_NAMESPACE)
|
247
250
|
config = {
|
248
251
|
'workflow_name': target_workflow_name,
|
249
252
|
'service_name': external_service_docker_compose.service_name
|
@@ -252,16 +255,28 @@ class TestScaffoldE2e():
|
|
252
255
|
with open(f"{command.public_dir_path}/shared_file.txt", 'w') as file:
|
253
256
|
file.write('this is a shared file')
|
254
257
|
|
255
|
-
|
258
|
+
# Use parameterized workflow up method
|
259
|
+
if workflow_up_method == 'cli':
|
260
|
+
ScaffoldCliInvoker.cli_workflow_up(runner, app_dir_path, target_workflow_name)
|
261
|
+
else: # makefile
|
262
|
+
ScaffoldCliInvoker.makefile_workflow_up(runner, app_dir_path, target_workflow_name)
|
256
263
|
|
257
264
|
@pytest.fixture(scope="class", autouse=True)
|
258
|
-
def cleanup_after_all(self, runner, app_dir_path, target_workflow_name):
|
265
|
+
def cleanup_after_all(self, runner, app_dir_path, target_workflow_name, workflow_up_method):
|
259
266
|
yield
|
260
|
-
|
261
|
-
|
267
|
+
# Use the same method for down as was used for up
|
268
|
+
if workflow_up_method == 'cli':
|
269
|
+
ScaffoldCliInvoker.cli_workflow_down(runner, app_dir_path, target_workflow_name)
|
270
|
+
else: # makefile
|
271
|
+
ScaffoldCliInvoker.makefile_workflow_down(runner, app_dir_path, target_workflow_name)
|
272
|
+
|
273
|
+
@pytest.fixture(scope='class', params=['cli', 'makefile'])
|
274
|
+
def workflow_up_method(self, request):
|
275
|
+
"""Parameterized fixture that alternates between CLI and Makefile workflow up methods."""
|
276
|
+
return request.param
|
262
277
|
|
263
278
|
def test_no_core_services(self, app_dir_path, target_workflow_name):
|
264
|
-
app = App(app_dir_path,
|
279
|
+
app = App(app_dir_path, SERVICES_NAMESPACE)
|
265
280
|
config = {
|
266
281
|
'workflow_name': target_workflow_name,
|
267
282
|
'service_name': 'build'
|
@@ -271,7 +286,7 @@ class TestScaffoldE2e():
|
|
271
286
|
command.validate()
|
272
287
|
|
273
288
|
def test_user_services(self, app_dir_path, target_workflow_name, external_service_docker_compose, local_service_docker_compose):
|
274
|
-
app = App(app_dir_path,
|
289
|
+
app = App(app_dir_path, SERVICES_NAMESPACE)
|
275
290
|
|
276
291
|
config = {
|
277
292
|
'workflow_name': target_workflow_name,
|
@@ -292,7 +307,7 @@ class TestScaffoldE2e():
|
|
292
307
|
pass
|
293
308
|
|
294
309
|
def test_assets(self, app_dir_path, target_workflow_name):
|
295
|
-
app = App(app_dir_path,
|
310
|
+
app = App(app_dir_path, SERVICES_NAMESPACE)
|
296
311
|
config = {
|
297
312
|
'workflow_name': target_workflow_name,
|
298
313
|
'service_name': 'assets'
|
File without changes
|
@@ -7,7 +7,7 @@ from stoobly_agent.app.cli import scaffold
|
|
7
7
|
from stoobly_agent.config.data_dir import DATA_DIR_NAME
|
8
8
|
|
9
9
|
|
10
|
-
class
|
10
|
+
class LocalScaffoldCliInvoker():
|
11
11
|
|
12
12
|
@staticmethod
|
13
13
|
def cli_app_create(runner: CliRunner, app_dir_path: str, app_name: str):
|
@@ -15,6 +15,8 @@ class ScaffoldCliInvoker():
|
|
15
15
|
|
16
16
|
result = runner.invoke(scaffold, ['app', 'create',
|
17
17
|
'--app-dir-path', app_dir_path,
|
18
|
+
'--proxy-port', '8081',
|
19
|
+
'--run-on', 'local',
|
18
20
|
'--quiet',
|
19
21
|
app_name
|
20
22
|
])
|
@@ -23,17 +25,6 @@ class ScaffoldCliInvoker():
|
|
23
25
|
output = result.stdout
|
24
26
|
assert not output
|
25
27
|
|
26
|
-
@staticmethod
|
27
|
-
def cli_app_mkcert(runner: CliRunner, app_dir_path: str):
|
28
|
-
result = runner.invoke(scaffold, ['app', 'mkcert',
|
29
|
-
'--app-dir-path', app_dir_path,
|
30
|
-
'--context-dir-path', app_dir_path,
|
31
|
-
])
|
32
|
-
|
33
|
-
assert result.exit_code == 0
|
34
|
-
output = result.stdout
|
35
|
-
assert not output
|
36
|
-
|
37
28
|
@staticmethod
|
38
29
|
def cli_service_create(runner: CliRunner, app_dir_path: str, hostname: str, service_name: str, https: bool):
|
39
30
|
scheme = 'http'
|
@@ -58,25 +49,17 @@ class ScaffoldCliInvoker():
|
|
58
49
|
output = result.stdout
|
59
50
|
assert not output
|
60
51
|
|
61
|
-
# Specific flags for assets
|
62
52
|
@staticmethod
|
63
|
-
def
|
64
|
-
|
65
|
-
port = '80'
|
66
|
-
if https == True:
|
67
|
-
scheme = 'https'
|
68
|
-
port = '443'
|
69
|
-
|
53
|
+
def cli_service_create_local(runner: CliRunner, app_dir_path: str, hostname: str, service_name: str):
|
54
|
+
"""Create a local service (not external)"""
|
70
55
|
result = runner.invoke(scaffold, ['service', 'create',
|
71
56
|
'--app-dir-path', app_dir_path,
|
72
57
|
'--hostname', hostname,
|
73
|
-
'--scheme',
|
74
|
-
'--port',
|
75
|
-
'--proxy-mode', 'reverse',
|
76
|
-
'--upstream-hostname', hostname,
|
77
|
-
'--upstream-port', 8080,
|
78
|
-
'--detached',
|
58
|
+
'--scheme', 'http',
|
59
|
+
'--port', '3000',
|
79
60
|
'--quiet',
|
61
|
+
'--workflow', 'mock',
|
62
|
+
'--workflow', 'record',
|
80
63
|
'--workflow', 'test',
|
81
64
|
service_name
|
82
65
|
])
|
@@ -104,21 +87,40 @@ class ScaffoldCliInvoker():
|
|
104
87
|
])
|
105
88
|
|
106
89
|
assert result.exit_code == 0
|
107
|
-
output = result.stdout
|
108
|
-
assert not output
|
109
90
|
|
110
91
|
@staticmethod
|
111
92
|
def cli_workflow_up(runner: CliRunner, app_dir_path: str, target_workflow_name: str):
|
112
93
|
command = ['workflow', 'up',
|
113
94
|
'--app-dir-path', app_dir_path,
|
114
95
|
'--context-dir-path', app_dir_path,
|
96
|
+
'--yes',
|
115
97
|
target_workflow_name,
|
116
98
|
]
|
117
99
|
result = runner.invoke(scaffold, command)
|
118
100
|
|
101
|
+
if result.exit_code != 0:
|
102
|
+
print(f"Command failed with exit code {result.exit_code}")
|
103
|
+
print(f"Output: {result.output}")
|
104
|
+
print(f"Exception: {result.exception}")
|
105
|
+
|
119
106
|
assert result.exit_code == 0
|
120
|
-
|
121
|
-
|
107
|
+
return result
|
108
|
+
|
109
|
+
@staticmethod
|
110
|
+
def cli_workflow_logs(runner: CliRunner, app_dir_path: str, target_workflow_name: str):
|
111
|
+
command = ['workflow', 'logs',
|
112
|
+
'--app-dir-path', app_dir_path,
|
113
|
+
target_workflow_name,
|
114
|
+
]
|
115
|
+
result = runner.invoke(scaffold, command)
|
116
|
+
|
117
|
+
if result.exit_code != 0:
|
118
|
+
print(f"Logs command failed with exit code {result.exit_code}")
|
119
|
+
print(f"Output: {result.output}")
|
120
|
+
print(f"Exception: {result.exception}")
|
121
|
+
|
122
|
+
assert result.exit_code == 0
|
123
|
+
return result
|
122
124
|
|
123
125
|
@staticmethod
|
124
126
|
def cli_workflow_down(runner: CliRunner, app_dir_path: str, target_workflow_name: str):
|
@@ -129,6 +131,10 @@ class ScaffoldCliInvoker():
|
|
129
131
|
]
|
130
132
|
result = runner.invoke(scaffold, command)
|
131
133
|
|
134
|
+
if result.exit_code != 0:
|
135
|
+
print(f"Down command failed with exit code {result.exit_code}")
|
136
|
+
print(f"Output: {result.output}")
|
137
|
+
print(f"Exception: {result.exception}")
|
138
|
+
|
132
139
|
assert result.exit_code == 0
|
133
|
-
|
134
|
-
assert output
|
140
|
+
return result
|