-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into person/mzhivkov/filter-by-job-start-end-time
- Loading branch information
Showing
61 changed files
with
810 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,18 @@ if [ "$RUN_ENVIRONMENT_SETUP" = 'y' ]; then | |
--docker-password="$CICD_CONTAINER_REGISTRY_USER_PASSWORD" \ | ||
--docker-email="[email protected]" --dry-run=client -o yaml | kubectl apply -f - | ||
kubectl patch serviceaccount default -p '{"imagePullSecrets":[{"name":"'$secret_name'"}]}' | ||
|
||
if [ -n "$DOCKERHUB_READONLY_USERNAME" ]; then | ||
dockerhub_secretname='secret-dockerhub-docker' | ||
kubectl create secret docker-registry "$dockerhub_secretname" \ | ||
--docker-server="https://index.docker.io/v1/" \ | ||
--docker-username="$DOCKERHUB_READONLY_USERNAME" \ | ||
--docker-password="$DOCKERHUB_READONLY_PASSWORD" \ | ||
--docker-email="[email protected]" --dry-run=client -o yaml | kubectl apply -f - | ||
|
||
kubectl patch serviceaccount default -p '{"imagePullSecrets":[{"name":"'$secret_name'"},{"name":"'$dockerhub_secretname'"}]}' | ||
fi | ||
|
||
fi | ||
|
||
# this is the internal hostname of the Control Service. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,6 +116,10 @@ credentials: | |
## The owner name and email address that will be used to send all Versatile Data Kit related email notifications. | ||
notificationOwnerEmail: "[email protected]" | ||
notificationOwnerName: "Versatile Data Kit" | ||
### Coma separate list of mails which will be cc-ed for Control Service managed notifications | ||
### This does not apply for notifications managed by external services (like AlertManager) | ||
#notificationCcEmails: "[email protected],[email protected]" | ||
|
||
|
||
### deploymentXXX refer to properties used in order to deploy a Data Job. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
...rvice/src/integration-test/java/com/vmware/taurus/graphql/it/GraphQLDataJobsFieldsIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* | ||
* Copyright 2021 VMware, Inc. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.vmware.taurus.graphql.it; | ||
|
||
import com.vmware.taurus.datajobs.it.common.BaseDataJobDeploymentIT; | ||
import com.vmware.taurus.service.JobsRepository; | ||
import com.vmware.taurus.service.model.ExecutionStatus; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.MediaType; | ||
|
||
import java.time.OffsetDateTime; | ||
import java.time.ZoneOffset; | ||
|
||
import static org.hamcrest.Matchers.greaterThan; | ||
import static org.hamcrest.Matchers.is; | ||
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user; | ||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; | ||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; | ||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; | ||
|
||
public class GraphQLDataJobsFieldsIT extends BaseDataJobDeploymentIT { | ||
|
||
private static final String DEFAULT_QUERY_WITH_DEPLOYMENTS = | ||
"query($filter: [Predicate], $executionFilter: [Predicate], $search: String, $pageNumber: Int, $pageSize: Int) {" + | ||
" jobs(pageNumber: $pageNumber, pageSize: $pageSize, filter: $filter, search: $search) {" + | ||
" content {" + | ||
" jobName" + | ||
" deployments {" + | ||
" id" + | ||
" enabled" + | ||
" lastExecutionStatus" + | ||
" lastExecutionTime" + | ||
" lastExecutionDuration" + | ||
" executions(pageNumber: 1, pageSize: 5, filter: $executionFilter) {" + | ||
" id" + | ||
" status" + | ||
" }" + | ||
" }" + | ||
" config {" + | ||
" team" + | ||
" description" + | ||
" schedule {" + | ||
" scheduleCron" + | ||
" nextRunEpochSeconds" + | ||
" }" + | ||
" }" + | ||
" }" + | ||
" totalPages" + | ||
" totalItems" + | ||
" }" + | ||
"}"; | ||
|
||
@Autowired | ||
private JobsRepository jobsRepository; | ||
|
||
@Test | ||
void testFields(String jobName, String teamName, String username) throws Exception { | ||
var dataJob = jobsRepository.findById(jobName).get(); | ||
dataJob.setLastExecutionStatus(ExecutionStatus.FINISHED); | ||
dataJob.setLastExecutionEndTime(OffsetDateTime.of(2000, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)); | ||
dataJob.setLastExecutionDuration(1000); | ||
dataJob = jobsRepository.save(dataJob); | ||
|
||
// Test requesting of fields that are computed | ||
mockMvc.perform(get(JOBS_URI) | ||
.with(user(username)) | ||
.param("query", DEFAULT_QUERY_WITH_DEPLOYMENTS) | ||
.param("variables", "{" + | ||
"\"search\": \"" + jobName + "\"," + | ||
"\"pageNumber\": 1," + | ||
"\"pageSize\": 10," + | ||
"\"executionFilter\": [" + | ||
" {" + | ||
" \"sort\": \"DESC\"," + | ||
" \"property\": \"deployments.executions.status\"" + | ||
" }" + | ||
" ]" + | ||
"}") | ||
.contentType(MediaType.APPLICATION_JSON)) | ||
.andExpect(status().isOk()) | ||
.andExpect(jsonPath("$.data.content[0].config.team", is(teamName))) | ||
.andExpect(jsonPath("$.data.content[0].config.schedule.scheduleCron", is(dataJob.getJobConfig().getSchedule()))) | ||
.andExpect(jsonPath("$.data.content[0].config.schedule.nextRunEpochSeconds", greaterThan(1))) | ||
.andExpect(jsonPath("$.data.content[0].deployments[0].lastExecutionStatus", is(dataJob.getLastExecutionStatus().name()))) | ||
.andExpect(jsonPath("$.data.content[0].deployments[0].lastExecutionTime", isDate(dataJob.getLastExecutionEndTime()))) | ||
.andExpect(jsonPath("$.data.content[0].deployments[0].lastExecutionDuration", is(dataJob.getLastExecutionDuration()))) | ||
.andReturn().getResponse().getContentAsString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.