forked from TrueCloudLab/distribution
0b4311d5ce
Use consts to make clear these values are fixed, and improve the output to make it clearer which part is the expected output, and which part the actual. Before this: === RUN TestManifest manifest_test.go:87: manifest bytes not equal: "{\n \"schemaVersion\": 2,\n \"mediaType\": \"application/vnd.oci.image.manifest.v1+json\",\n \"config\": {\n \"mediaType\": \"application/vnd.oci.image.config.v1+json\",\n \"size\": 985,\n \"digest\": \"sha256:1a9ec845ee94c202b2d5da74a24f0ed2058318bfa9879fa541efaecba272e86b\",\n \"annotations\": {\n \"apple\": \"orange\"\n }\n },\n \"layers\": [\n {\n \"mediaType\": \"application/vnd.oci.image.layer.v1.tar+gzip\",\n \"size\": 153263,\n \"digest\": \"sha256:62d8908bee94c202b2d35224a221aaa2058318bfa9879fa541efaecba272331b\",\n \"annotations\": {\n \"lettuce\": \"wrap\"\n }\n }\n ],\n \"annotations\": {\n \"hot\": \"potato\"\n }\n}" != "{\n \"schemaVersion\": 2,\n \"mediaType\": \"application/vnd.oci.image.manifest.v1+json\",\n \"config\": {\n \"mediaType\": \"application/vnd.oci.image.config.v1+json\",\n \"size\": 985,\n \"digest\": \"sha256:1a9ec845ee94c202b2d5da74a24f0ed2058318bfa9879fa541efaecba272e86b\",\n \"annotations\": {\n \"apple\": \"orange\"\n }\n },\n \"layers\": [\n {\n \"mediaType\": \"application/vnd.oci.image.layer.v1.tar+gzip\",\n \"size\": 153263,\n \"digest\": \"sha256:62d8908bee94c202b2d35224a221aaa2058318bfa9879fa541efaecba272331b\",\n \"annotations\": {\n \"lettuce\": \"wrap\"\n }\n }\n ],\n \"annotations\": {\n \"hot\": \"potato\"\n }\n}" --- FAIL: TestManifest (0.00s) After this: === RUN TestManifest manifest_test.go:72: manifest bytes not equal: expected: { "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "config": { "mediaType": "application/vnd.docker.container.image.v1+json", "size": 985, "digest": "sha256:1a9ec845ee94c202b2d5da74a24f0ed2058318bfa9879fa541efaecba272e86b" }, "layers": [ { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 153263, "digest": "sha256:62d8908bee94c202b2d35224a221aaa2058318bfa9879fa541efaecba272331b" } ] } actual: { "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "config": { "mediaType": "application/vnd.docker.container.image.v1+json", "size": 985, "digest": "sha256:1a9ec845ee94c202b2d5da74a24f0ed2058318bfa9879fa541efaecba272e86b" }, "layers": [ { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 153263, "digest": "sha256:62d8908bee94c202b2d35224a221aaa2058318bfa9879fa541efaecba272331b" } ] } --- FAIL: TestManifest (0.00s) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> |
||
---|---|---|
.. | ||
config_builder.go | ||
config_builder_test.go | ||
manifest.go | ||
manifest_test.go | ||
reference_builder.go | ||
reference_builder_test.go | ||
sign.go | ||
verify.go |