Commit 72603892 authored by Lucas Fernandes de Oliveira's avatar Lucas Fernandes de Oliveira

Merge branch 'issue/10' into 'develop'

Issue #10: Update usql-manager

See merge request !11
parents f31fd461 8e416fd3
Pipeline #21092 passed with stage
in 1 minute and 2 seconds
image: debian:stretch
image: debian:buster
services:
- "postgres:10"
-
name: "dockerregistry.c3sl.ufpr.br:5000/c3sl/monetdb-ci-service:latest"
alias: "monet"
variables:
POSTGRES_DB: 'postgres'
POSTGRES_USER: 'postgres'
PGPASSWORD: 'postgres'
POSTGRES_DB: 'biod'
POSTGRES_USER: 'runner'
PGPASSWORD: 'pass'
POSTGRES_HOST: 'postgres'
MONETDB_NAME: 'monetdb'
GIT_SUBMODULE_STRATEGY: normal
stages:
- test
run_test:
test_postgres:
stage: test
script:
variables:
DB_NAME: 'biod'
DB_USER: 'runner'
DB_HOST: 'postgres'
DB_PASSWORD: 'pass'
script:
- apt-get update -q -y
- apt-get install wget gnupg -y
- echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" > /etc/apt/sources.list.d/pgdg.list
- apt-get install bzip2 wget gnupg -y
- echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" > /etc/apt/sources.list.d/pgdg.list
- wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
- apt-get update -q -y
- apt-get install -y postgresql-client-10
- ./psql-manager/manager.sh create ./data/
- ./psql-manager/manager.sh fixture ./data/
- apt-get install -y postgresql-client-10
- ./test/psql.sh
tags:
- debian
- postgres
test_monet:
stage: test
variables:
DB_NAME: 'monetdb'
DB_USER: 'monetdb'
DB_HOST: 'monet'
DB_PASSWORD: 'monetdb'
script:
- apt-get update -q -y
- apt-get install bzip2 wget gnupg -y
- echo "deb https://dev.monetdb.org/downloads/deb/ buster monetdb" > /etc/apt/sources.list.d/monetdb.list
- wget --quiet -O - https://www.monetdb.org/downloads/MonetDB-GPG-KEY | apt-key add -
- apt-get update -q -y
- apt-get install -y monetdb-client
- ./test/monet.sh
tags:
- debian
- monet
[submodule "psql-manager"]
path = psql-manager
url = https://gitlab.c3sl.ufpr.br/c3sl/psql-manager.git
[submodule "usql-manager"]
path = usql-manager
url = https://gitlab.c3sl.ufpr.br/c3sl/usql-manager.git
This diff is collapsed.
This diff is collapsed.
id;regiao_id;nome;sigla
11;1;Rondônia;RO
12;1;Acre;AC
13;1;Amazonas;AM
14;1;Roraima;RR
15;1;Pará;PA
id;area_cod;area_nome;curso_cod;curso;grau_academico
1;1;Educação;142A01;Processos Escolares - Tecnológico;Tecnológico
2;1;Educação;142C01;Pedagogia (Ciências da Educação) - Bacharelado;Bacharelado
3;1;Educação;142P01;Pedagogia - Licenciatura;Licenciatura
4;1;Educação;144F12;Licenciatura Interdisciplinar em Ciências Humanas - Licenciatura;Licenciatura
5;1;Educação;144F13;Licenciatura Intercultural Indígena - Licenciatura ;Licenciatura
id;nome;cod_uf;cod_municipio;cod_dep_adm;dep_adm_nome;instituicao_tipo;cond_funcionamento
1;"UNIVERSIDADE FEDERAL DE MATO GROSSO";51;5103403;1;"FEDERAL";"PUBLICA";true
2;"UNIVERSIDADE DE BRASILIA";53;5300108;1;"FEDERAL";"PUBLICA";true
3;"UNIVERSIDADE FEDERAL DE SERGIPE";28;2806701;1;"FEDERAL";"PUBLICA";true
4;"UNIVERSIDADE FEDERAL DO AMAZONAS";13;1302603;1;"FEDERAL";"PUBLICA";true
5;"UNIVERSIDADE FEDERAL DO PIAUI";22;2211001;1;"FEDERAL";"PUBLICA";true
200013 ;ACRELANDIA; 12
1200054 ;ASSIS BRASIL; 12
1200104 ;BRASILEIA; 12
1200138 ;BUJARI; 12
1200179 ;CAPIXABA; 12
id;nome;estado_id
200013;ACRELANDIA;12
1200054;ASSISBRASIL;12
1200104;BRASILEIA;12
1200138;BUJARI;12
id;nome
1;Norte
2;Nordeste
3;Sudeste
4;Sul
5;Centro-Oeste
ano_censo;estado_id;municipio_id;total_impostos;total_mde;fundeb
2016;52;5213772;10988537.8;2747134.5;3345714.2
2016;52;5215207;11294874.9;2823718.7;1570900
2016;43;4317251;10511508.7;2627877.2;406517.7
2016;52;5220157;14976324.1;3744081;3744246.4
2016;14;1400407;7696589.9;1924147.5;10124280.7
ano_censo;estado_id;total_impostos;total_mde;fundeb
2016;14;2886527622.1;721631905.5;393746186.2
2016;17;6069250239.4;1517312559.9;764069679.8
2016;16;3743518013.2;935879503.3;534250736.8
2016;53;12644813140.7;3161203285.2;1913314696.8
2016;35;112629975223.2;28157493805.8;15708698515.1
Subproject commit 10bce2d2249d2a51a44764b825a88272238648b4
#! /bin/bash
error=0
basePath=$(echo $BASH_SOURCE | rev | cut -c 9- | rev)
cd $basePath/..
TMP_DIR=$(mktemp -d)
# Before all tests
./usql-manager/manager.sh monet drop ./data/ &> /dev/null
echo "Should create the database"
./usql-manager/manager.sh monet create ./data/ &> $TMP_DIR/create.out
if [[ $? -eq 0 ]]; then
echo -e "\tSucess"
else
error=$(($error +1))
echo -e "\tFail"
fi
echo "The number of tables and views created should be 65"
value=$(cat $TMP_DIR/create.out | grep "operation successful" | wc -l)
if [[ $value -eq 65 ]]; then
echo -e "\tSucess"
else
error=$(($error +1))
echo -e "\tFail"
fi
echo "Should load the fixtures"
./usql-manager/manager.sh monet fixture ./data/ &> $TMP_DIR/fixture.out
if [[ $? -eq 0 ]]; then
echo -e "\tSucess"
else
error=$(($error +1))
echo -e "\tFail"
fi
echo "All 29 table should have 4 records"
value=$(cat $TMP_DIR/fixture.out | grep "4 affected rows" | wc -l)
if [[ $value -eq 29 ]]; then
echo -e "\tSucess"
else
error=$(($error +1))
echo -e "\tFail"
fi
echo "Should drop the database"
./usql-manager/manager.sh monet drop ./data/ &> $TMP_DIR/drop.out
if [[ $? -eq 0 ]]; then
echo -e "\tSucess"
else
error=$(($error +1))
echo -e "\tFail"
fi
rm -rf $TMP_DIR
echo "$error error(s) occured."
if [[ $error -gt 0 ]]; then
exit 1
else
exit 0
fi
#! /bin/bash
error=0
basePath=$(echo $BASH_SOURCE | rev | cut -c 8- | rev)
cd $basePath/..
TMP_DIR=$(mktemp -d)
# Before all tests
./usql-manager/manager.sh psql drop ./data/ &> /dev/null
echo "Should create the database"
./usql-manager/manager.sh psql create ./data/ &> $TMP_DIR/create.out
if [[ $? -eq 0 ]]; then
echo -e "\tSucess"
else
error=$(($error +1))
echo -e "\tFail"
fi
echo "The number of tables and views created should be 65"
value1=$(cat $TMP_DIR/create.out | grep "CREATE TABLE" | wc -l)
value2=$(cat $TMP_DIR/create.out | grep "CREATE VIEW" | wc -l)
value=$(($value1 + $value2))
if [[ $value -eq 65 ]]; then
echo -e "\tSucess"
else
error=$(($error +1))
echo -e "\tFail"
fi
echo "Should load the fixtures"
./usql-manager/manager.sh psql fixture ./data/ &> $TMP_DIR/fixture.out
if [[ $? -eq 0 ]]; then
echo -e "\tSucess"
else
error=$(($error +1))
echo -e "\tFail"
fi
echo "All 29 table should have 4 records"
value=$(cat $TMP_DIR/fixture.out | grep "COPY 4" | wc -l)
if [[ $value -eq 29 ]]; then
echo -e "\tSucess"
else
error=$(($error +1))
echo -e "\tFail"
fi
echo "Should drop the database"
./usql-manager/manager.sh psql drop ./data/ &> $TMP_DIR/fixture.out
if [[ $? -eq 0 ]]; then
echo -e "\tSucess"
else
error=$(($error +1))
echo -e "\tFail"
fi
rm -rf $TMP_DIR
echo "$error error(s) occured."
if [[ $error -gt 0 ]]; then
exit 1
else
exit 0
fi
Subproject commit f4b596ae40e17dd0cb8dc71a23c9d44080cc9144
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment