blob: 31309eedd64974cc35d12dd442d6019ee3a573fa [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[53],{119:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return c})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return l}));var r=n(3),a=n(7),i=(n(0),n(144)),o={title:"How to Run Integration K8s Test"},c={unversionedId:"devDocs/IntegrationTestK8s",id:"devDocs/IntegrationTestK8s",isDocsHomePage:!1,title:"How to Run Integration K8s Test",description:"\x3c!---",source:"@site/docs/devDocs/IntegrationTestK8s.md",slug:"/devDocs/IntegrationTestK8s",permalink:"/docs/devDocs/IntegrationTestK8s",editUrl:"https://github.com/apache/submarine/edit/master/website/docs/devDocs/IntegrationTestK8s.md",version:"current",sidebar:"docs",previous:{title:"Development Guide",permalink:"/docs/devDocs/Development"},next:{title:"How to Run Frontend Integration Test",permalink:"/docs/devDocs/IntegrationTestE2E"}},s=[{value:"Introduction",id:"introduction",children:[]},{value:"Run k8s test locally",id:"run-k8s-test-locally",children:[]},{value:"Run k8s test in GitHub Actions",id:"run-k8s-test-in-github-actions",children:[]}],u={toc:s};function l(e){var t=e.components,o=Object(a.a)(e,["components"]);return Object(i.b)("wrapper",Object(r.a)({},u,o,{components:t,mdxType:"MDXLayout"}),Object(i.b)("h2",{id:"introduction"},"Introduction"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("p",{parentName:"li"},"The test cases under the directory ",Object(i.b)("inlineCode",{parentName:"p"},"test-k8s")," are integration tests to ensure the correctness of the Submarine RESTful API.")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("p",{parentName:"li"},"You can run these tests either locally or on GitHub Actions."),Object(i.b)("ul",{parentName:"li"},Object(i.b)("li",{parentName:"ul"},"Before running the tests, the minikube (KinD) cluster must be created. "),Object(i.b)("li",{parentName:"ul"},"Then, compile and package the submarine project in ",Object(i.b)("inlineCode",{parentName:"li"},"submarine-dist")," directory for building a docker image. "),Object(i.b)("li",{parentName:"ul"},"In addition, the 8080 port in submarine-traefik should be forwarded.")))),Object(i.b)("h2",{id:"run-k8s-test-locally"},"Run k8s test locally"),Object(i.b)("ol",null,Object(i.b)("li",{parentName:"ol"},Object(i.b)("p",{parentName:"li"},"Ensure you have setup the KinD cluster or minikube cluster. If you haven't, follow this ",Object(i.b)("a",{parentName:"p",href:"https://minikube.sigs.k8s.io/docs/start/"},Object(i.b)("inlineCode",{parentName:"a"},"minikube tutorial")))),Object(i.b)("li",{parentName:"ol"},Object(i.b)("p",{parentName:"li"},"Build the submarine from source and upgrade the server pod through this ",Object(i.b)("a",{parentName:"p",href:"./Development/#build-from-source"},Object(i.b)("inlineCode",{parentName:"a"},"guide")))),Object(i.b)("li",{parentName:"ol"},Object(i.b)("p",{parentName:"li"},"Forward port"),Object(i.b)("pre",{parentName:"li"},Object(i.b)("code",{parentName:"pre",className:"language-bash"},"kubectl port-forward --address 0.0.0.0 service/submarine-traefik 8080:80\n"))),Object(i.b)("li",{parentName:"ol"},Object(i.b)("p",{parentName:"li"},"Execute the test command"),Object(i.b)("pre",{parentName:"li"},Object(i.b)("code",{parentName:"pre",className:"language-bash"},"mvn verify -DskipRat -pl :submarine-test-k8s -Phadoop-2.9 -B\n")))),Object(i.b)("p",null,Object(i.b)("img",{src:n(216).default})),Object(i.b)("h2",{id:"run-k8s-test-in-github-actions"},"Run k8s test in GitHub Actions"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"Each time a code is submitted, GitHub Actions is triggered automatically.")))}l.isMDXComponent=!0},144:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return m}));var r=n(0),a=n.n(r);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var u=a.a.createContext({}),l=function(e){var t=a.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},b=function(e){var t=l(e.components);return a.a.createElement(u.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,o=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),b=l(n),d=r,m=b["".concat(o,".").concat(d)]||b[d]||p[d]||i;return n?a.a.createElement(m,c(c({ref:t},u),{},{components:n})):a.a.createElement(m,c({ref:t},u))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,o=new Array(i);o[0]=d;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:r,o[1]=c;for(var u=2;u<i;u++)o[u]=n[u];return a.a.createElement.apply(null,o)}return a.a.createElement.apply(null,n)}d.displayName="MDXCreateElement"},216:function(e,t,n){"use strict";n.r(t),t.default=n.p+"assets/images/test-k8s-result-883d99774542cc9898f086937cb80190.png"}}]);