From 94576ec74700ff0b3806ffbb3c3be3e471aaa5c6 Mon Sep 17 00:00:00 2001 From: Kris De Volder Date: Thu, 2 Jun 2022 12:51:09 -0700 Subject: [PATCH] Add more tests for ReggistryImagePutParams --- .../vscode/concourse/ConcourseEditorTest.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java b/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java index d5f797534..075c0503e 100644 --- a/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java +++ b/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java @@ -2624,7 +2624,8 @@ public class ConcourseEditorTest { " aws_role_arns: a-list-of-arns\n" + " debug: no-bool\n" + " registry_mirror: {}\n" + - " content_trust: {}\n" + " content_trust: {}\n" + + " ca_certs: some-certs\n" ); editor.assertProblems( @@ -2637,7 +2638,8 @@ public class ConcourseEditorTest { "a-list-of-arns|Expecting a 'Sequence'", "no-bool|boolean", "registry_mirror|'host' is required", - "content_trust|Properties [repository_key, repository_key_id, repository_passphrase] are required" + "content_trust|Properties [repository_key, repository_key_id, repository_passphrase] are required", + "some-certs|Expecting a 'Sequence'" ); editor.assertHoverContains("repository", "The name of the repository"); @@ -2662,6 +2664,9 @@ public class ConcourseEditorTest { " type: registry-image\n" + " source:\n" + " repository: kdvolder/sts4-build-env\n" + + " ca_certs:\n" + + " - cert1\n" + + " - cert2\n" + " registry_mirror:\n" + " host: mirrorhost\n" + " username: mirroruser\n" + @@ -2721,7 +2726,11 @@ public class ConcourseEditorTest { @Test public void registryImageResourcePutParamsReconcileAndHovers() throws Exception { Editor editor; - + + //TODO: new properties + // version + // bump_aliases + editor = harness.newEditor( "resources:\n" + "- name: my-docker-image\n" + @@ -2732,6 +2741,8 @@ public class ConcourseEditorTest { " - put: my-docker-image\n" + " params:\n" + " image: path/to/image/tarball\n" + + " version: some-version\n" + + " bump_aliases: is-bump\n" + " additional_tags: path/to/tagsfiles\n" + " bogus: bad\n" + " get_params:\n" + @@ -2739,11 +2750,14 @@ public class ConcourseEditorTest { ); editor.assertProblems( + "is-bump|boolean", "bogus|Unknown property", "bad-format|Valid values are: [oci, rootfs]" ); editor.assertHoverContains("image", 4, "path to the OCI image tarball"); + editor.assertHoverContains("version", "version number to use as a tag"); + editor.assertHoverContains("bump_aliases", "automatically bump alias tags"); editor.assertHoverContains("additional_tags", "list of tag values"); editor.assertHoverContains("format", "The format to fetch as"); }