<commit_before>package de.gesellix.docker.client

import de.gesellix.docker.engine.DockerVersion
import groovy.util.logging.Slf4j
import spock.lang.Requires
import spock.lang.Specification

@Slf4j
@Requires({ LocalDocker.available() })
class DockerDistributionIntegrationSpec extends Specification {

    static DockerClient dockerClient

    def setupSpec() {
        dockerClient = new DockerClientImpl()
    }

    @Requires({ LocalDocker.dockerVersion >= DockerVersion.parseDockerVersion("17.06") })
    def "can retrieve an image descriptor for alpine:edge"() {
        when:
        def alpineDescriptor = dockerClient.descriptor("alpine:edge")

        then:
        alpineDescriptor.status.code == 200
        alpineDescriptor.content.Descriptor.mediaType == "application/vnd.docker.distribution.manifest.list.v2+json"
        alpineDescriptor.content.Descriptor.digest =~ "sha256:[a-f0-9]{64}"
        alpineDescriptor.content.Descriptor.size =~ "\\d{3,4}"
        alpineDescriptor.content.Platforms == [
                [architecture: "amd64", os: "linux"],
                [architecture: "arm", os: "linux", variant: "v6"],
                [architecture: "arm", os: "linux", variant: "v7"],
                [architecture: "arm64", os: "linux", variant: "v8"],
                [architecture: "386", os: "linux"],
                [architecture: "ppc64le", os: "linux"],
                [architecture: "s390x", os: "linux"],

        ]
    }

    @Requires({ LocalDocker.dockerVersion >= DockerVersion.parseDockerVersion("17.06") })
    def "can retrieve an image descriptor for debian:latest"() {
        when:
        def debianDescriptor = dockerClient.descriptor("debian:latest")

        then:
        debianDescriptor.status.code == 200
        debianDescriptor.content.Descriptor.mediaType == "application/vnd.docker.distribution.manifest.list.v2+json"
        debianDescriptor.content.Descriptor.digest =~ "sha256:[a-f0-9]{64}"
        debianDescriptor.content.Descriptor.size =~ "\\d{3,4}"
        debianDescriptor.content.Platforms == [
                [architecture: "amd64", os: "linux"],
                [architecture: "arm", os: "linux", variant: "v5"],
                [architecture: "arm", os: "linux", variant: "v7"],
                [architecture: "arm64", os: "linux", variant: "v8"],
                [architecture: "386", os: "linux"],
                [architecture: "ppc64le", os: "linux"],
                [architecture: "s390x", os: "linux"]
        ]
    }
}<commit_msg>adds 'mips64le' to debian's supported architectures in 'DockerDistributonIntegrationSpec' to prevent a test failure<commit_after>package de.gesellix.docker.client

import de.gesellix.docker.engine.DockerVersion
import groovy.util.logging.Slf4j
import spock.lang.Requires
import spock.lang.Specification

@Slf4j
@Requires({ LocalDocker.available() })
class DockerDistributionIntegrationSpec extends Specification {

    static DockerClient dockerClient

    def setupSpec() {
        dockerClient = new DockerClientImpl()
    }

    @Requires({ LocalDocker.dockerVersion >= DockerVersion.parseDockerVersion("17.06") })
    def "can retrieve an image descriptor for alpine:edge"() {
        when:
        def alpineDescriptor = dockerClient.descriptor("alpine:edge")

        then:
        alpineDescriptor.status.code == 200
        alpineDescriptor.content.Descriptor.mediaType == "application/vnd.docker.distribution.manifest.list.v2+json"
        alpineDescriptor.content.Descriptor.digest =~ "sha256:[a-f0-9]{64}"
        alpineDescriptor.content.Descriptor.size =~ "\\d{3,4}"
        alpineDescriptor.content.Platforms == [
                [architecture: "amd64", os: "linux"],
                [architecture: "arm", os: "linux", variant: "v6"],
                [architecture: "arm", os: "linux", variant: "v7"],
                [architecture: "arm64", os: "linux", variant: "v8"],
                [architecture: "386", os: "linux"],
                [architecture: "ppc64le", os: "linux"],
                [architecture: "s390x", os: "linux"],

        ]
    }

    @Requires({ LocalDocker.dockerVersion >= DockerVersion.parseDockerVersion("17.06") })
    def "can retrieve an image descriptor for debian:latest"() {
        when:
        def debianDescriptor = dockerClient.descriptor("debian:latest")

        then:
        debianDescriptor.status.code == 200
        debianDescriptor.content.Descriptor.mediaType == "application/vnd.docker.distribution.manifest.list.v2+json"
        debianDescriptor.content.Descriptor.digest =~ "sha256:[a-f0-9]{64}"
        debianDescriptor.content.Descriptor.size =~ "\\d{3,4}"
        debianDescriptor.content.Platforms == [
                [architecture: "amd64", os: "linux"],
                [architecture: "arm", os: "linux", variant: "v5"],
                [architecture: "arm", os: "linux", variant: "v7"],
                [architecture: "arm64", os: "linux", variant: "v8"],
                [architecture: "386", os: "linux"],
                [architecture: "mips64le", os: "linux"],
                [architecture: "ppc64le", os: "linux"],
                [architecture: "s390x", os: "linux"]
        ]
    }
}
{'fraction_non_alphanumeric': 0.14158435018400156, 'fraction_numerical': 0.026341274452837498, 'mean_word_length': 2.8054532056005894, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6992791', 'n_tokens_mistral': 1693, 'n_tokens_neox': 1464, 'n_words': 302}