<commit_before>#!/bin/bash
set -e

. setup.sh

unique() {
    echo `date +"%s"`
}

Test3() {
    echo "---------------- Test3 ----------------"

    echo 3-hello...
    sh 3-hello.sh | grep -q Hello

    echo PASS Test3
}

Test4a() {
    echo "---------------- Test4a ----------------"

    name="yournamehere"
    description="mydescription"
    filename="download.dat"
    
    echo "4-hosted-load..."
    jobId=`sh 4-hosted-load.sh $name $description | jq -r .data.jobId`
    echo "    jobId: $jobId"
    sleep 3
    dataId=`sh job-info.sh $jobId | jq -r .data.result.dataId`
    echo "    dataId: $dataId"
    actual=`sh data-info.sh $dataId | jq -r '.data.metadata.name'`

    if [ $actual != $name ]
    then
        echo FAIL
        exit 1
    fi
    
    echo "4-hosted-download..."
    sh 4-hosted-download.sh $dataId $filename
    if [ ! -s $filename ]
    then
        echo FAIL
        exit 1
    fi

    echo PASS Test4a
}

Test4b() {
    echo "---------------- Test4b ----------------"

    name="mynamehere"
    filename=

    echo "4-nonhosted-load..."
    jobId=`sh 4-nonhosted-load.sh $name | jq -r .data.jobId`
    echo "    jobId: $jobId"
    sleep 3
    dataId=`sh job-info.sh $jobId | jq -r .data.result.dataId`
    echo "    dataId: $dataId"
    actual=`sh data-info.sh $dataId | jq -r '.data.metadata.name'`

    if [ $actual != $name ]
    then
        echo FAIL
        exit 1
    fi

    echo "4-nonhosted-wms..."
    jobId=`sh 4-nonhosted-wms.sh $dataId | jq -r .data.jobId`
    echo "    jobId: $jobId"
    sleep 3
    url=`sh job-info.sh $jobId | jq -r .data.result.deployment.capabilitiesUrl`
    echo "    url: $url"
    html=`curl -S -s "$url"`
    echo "$html" | grep -q "GeoServer Web Feature Service"

    echo PASS Test4b
}

Test5() {
    echo "---------------- Test5 ----------------"

    name=kittens`unique`
    description="my description"
    echo "4-hosted-load.sh..."
    jobId=`sh 4-hosted-load.sh $name $description | jq -r .data.jobId`
    sleep 3<commit_msg>kitty tweaks<commit_after>#!/bin/bash
set -e

. setup.sh

unique() {
    echo `date +"%s"`
}

Test3() {
    echo "---------------- Test3 ----------------"

    echo 3-hello...
    sh 3-hello.sh | grep -q Hello

    echo PASS Test3
}

Test4a() {
    echo "---------------- Test4a ----------------"

    name="yournamehere"
    description="mydescription"
    filename="download.dat"
    
    echo "4-hosted-load..."
    jobId=`sh 4-hosted-load.sh $name $description | jq -r .data.jobId`
    echo "    jobId: $jobId"
    sleep 3
    dataId=`sh job-info.sh $jobId | jq -r .data.result.dataId`
    echo "    dataId: $dataId"
    actual=`sh data-info.sh $dataId | jq -r '.data.metadata.name'`

    if [ $actual != $name ]
    then
        echo FAIL
        exit 1
    fi
    
    echo "4-hosted-download..."
    sh 4-hosted-download.sh $dataId $filename
    if [ ! -s $filename ]
    then
        echo FAIL
        exit 1
    fi

    echo PASS Test4a
}

Test4b() {
    echo "---------------- Test4b ----------------"

    name="mynamehere"
    filename=

    echo "4-nonhosted-load..."
    jobId=`sh 4-nonhosted-load.sh $name | jq -r .data.jobId`
    echo "    jobId: $jobId"
    sleep 3
    dataId=`sh job-info.sh $jobId | jq -r .data.result.dataId`
    echo "    dataId: $dataId"
    actual=`sh data-info.sh $dataId | jq -r '.data.metadata.name'`

    if [ $actual != $name ]
    then
        echo FAIL
        exit 1
    fi

    echo "4-nonhosted-wms..."
    jobId=`sh 4-nonhosted-wms.sh $dataId | jq -r .data.jobId`
    echo "    jobId: $jobId"
    sleep 3
    url=`sh job-info.sh $jobId | jq -r .data.result.deployment.capabilitiesUrl`
    echo "    url: $url"
    html=`curl -S -s "$url"`
    echo "$html" | grep -q "GeoServer Web Feature Service"

    echo PASS Test4b
}

Test5() {
    echo "---------------- Test5 ----------------"

    name=kittens-`unique`
    description="kittens"
    echo "4-hosted-load.sh..."
    jobId=`sh 4-hosted-load.sh $name $description | jq -r .data.jobId`
    sleep 3
{'fraction_non_alphanumeric': 0.20079820404090795, 'fraction_numerical': 0.014966325767024195, 'mean_word_length': 1.6486129458388374, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6328681', 'n_tokens_mistral': 1532, 'n_tokens_neox': 1449, 'n_words': 357}