forked from eclipse-jkube/jkube
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix (jkube-kit/common) : Add NonValidationKeywords to JsonMetaSchema …
…in order to avoid schema validation warnings (eclipse-jkube#1934) Add additional NonValidationKeywords in ResourceValidator's JsonMetaSchema in order to avoid schema validation warnings about unknown keywords. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
- Loading branch information
1 parent
174d189
commit 31c9134
Showing
4 changed files
with
81 additions
and
4 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
53 changes: 53 additions & 0 deletions
53
...e-plugin/it/src/test/java/org/eclipse/jkube/gradle/plugin/tests/ResourceValidationIT.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,53 @@ | ||
/** | ||
* Copyright (c) 2019 Red Hat, Inc. | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at: | ||
* | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
package org.eclipse.jkube.gradle.plugin.tests; | ||
|
||
import org.gradle.testkit.runner.BuildResult; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import static org.assertj.core.api.AssertionsForClassTypes.assertThat; | ||
|
||
class ResourceValidationIT { | ||
@RegisterExtension | ||
private final ITGradleRunnerExtension gradleRunner = new ITGradleRunnerExtension(); | ||
|
||
@Test | ||
void k8sResource_whenRun_shouldValidateGeneratedResources() { | ||
// When | ||
final BuildResult result = gradleRunner.withITProject("spring-boot") | ||
.withArguments("build", "k8sResource", "--stacktrace") | ||
.build(); | ||
// Then | ||
assertThat(result).extracting(BuildResult::getOutput) | ||
.asString() | ||
.containsPattern("validating .*deployment.yml resource") | ||
.containsPattern("validating .*service.yml resource") | ||
.doesNotContain("Unknown keyword"); | ||
} | ||
|
||
@Test | ||
void ocResource_whenRun_shouldValidateGeneratedResources() { | ||
// When | ||
final BuildResult result = gradleRunner.withITProject("spring-boot") | ||
.withArguments("build", "ocResource", "--stacktrace") | ||
.build(); | ||
// Then | ||
assertThat(result).extracting(BuildResult::getOutput) | ||
.asString() | ||
.containsPattern("validating .*deploymentconfig.yml resource") | ||
.containsPattern("validating .*service.yml resource") | ||
.doesNotContain("Unknown keyword"); | ||
} | ||
} |
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