Now, Apache Submarine supports two kinds of integration test: test-e2e
and test-k8s
. These two modules can be found in the submarine/submarine-test directory.
Currently, there are some differences between test-e2e
and test-k8s
in operation mode. To elaborate, test-e2e
needs to deploy Apache Submarine locally, while test-k8s
deploys Apache Submarine via k8s.
These two test modules can be applied to different test scenarios. (In the future, these two test modules may be combined or adjusted)
k8s test: When the user submits the code to his/her repository or the apache/submarine
git repository, the travis test task will automatically start.
test-k8s runs test cases in travis. It will first create a k8s cluster by using the kind tool in travis,
and then compile and package the submarine project in submarine-dist
directory to build a docker image.
Then use this latest code to build a docker image and deploy a submarine system in k8s. Then run test case in the test-k8s/..
directory.
Executing the following command will perform the following actions:
mvn -Phadoop-2.9 clean package install -DskipTests verify -DskipRat -am -pl submarine-test/test-k8s
The submarine project will be compiled and packaged to generate submarine-dist/target/submarine-<version>.tar.gz
Call the submarine-cloud/hack/integration-test.sh
script
build.sh
script under submarine/dev-support/docker-images/
to generate the latest submarine
, database
and operator
docker images.submarine-cloud/hack/kind-cluster-build.sh
to create a k8s clustersubmarine-cloud/hack/deploy-submarine.sh
to deploy the submarine system in the k8s cluster using the latest submarine
, database
and operator
docker images.submarine-test/test-k8s/
for testing.Each time a code is submitted, travis is automatically triggered for testing.
cd submarine/submarine-workbench/workbench-web npm start // Check 127.0.0.1:4200
url = "http://localhost:8080";
--> url = "http://localhost:4200";
8080
--> 4200
headless
optionchromeOptions.addArguments("--headless");
--> //chromeOptions.addArguments("--headless");
headless
option, the selenium will be executed in background.headless
option is not commented in ChromeWebDriverProvider.java.https://travis-ci.org/${your_github_account}/${your_repo_name}
.cd submarine/submarine-test/test-e2e
Following command will compile all files and run all files ending with “IT” in the directory.
mvn verify
mvn clean install -U
Run a specific testcase
mvn -Dtest=${your_test_case_file_name} test //ex: mvn -Dtest=loginIT test
If all of the function under test are succeeded, it will show.
BUILD SUCCESS
Otherwise, it will show.
BUILD FAILURE
WebElement pollingWait(final By locator, final long timeWait); // Find element on the website. void clickAndWait(final By locator); // Click element and wait for 1 second. void sleep(long millis, boolean logOutput); // Let system sleep a period of time.
// In WebDriverManager.java: public static WebDriver getWebDriver(); // This return a firefox webdriver which has been set to your workbench website.