BuildID: 2478
Status: FAIL
Image: melezhik/sparrow:alpine
Worker status: OK
---
Date: 06.01.2023 @ 02:57
Time elapsed: 133 sec
---
SCM:
https://github.com/melezhik/protocol-postgres.git
Git sha: 67a6bbd
Git comment: Update sparrow.yaml
tasks:
-
name: int-test
default: true
language: Raku
depends:
-
name: install
-
name: install-pg
code: |
use v6.d;
use Protocol::Postgres;
my $socket = await IO::Socket::Async.connect("localhost",5432);
my $client = Protocol::Postgres::Client.new;
$socket.Supply(:bin).act({ $client.incoming-data($^data) });
$client.outbound-data.act({ $socket.write($^data) });
await $client.startup("testuser", "testdb", "testpass");
my $resultset = await $client.query('SELECT * FROM bar WHERE id = $1', 42);
react {
whenever $resultset.hash-rows -> (:$name, :$description) {
say "$name is $description";
}
}
-
name: install
language: Bash
code: |
set -e
cd source/
zef install . --/test
-
name: install-pg
plugin: sparkyci-service-postgresql
followup:
-
name: create-table
config:
db_name: testdb
db_user: testuser
db_pass: testpass
-
name: create-table
language: Bash
code: |
set -e
export PGPASSWORD=testpass
psql -d testdb -U testuser -c "create table bar(name text, description text, id int)" -h localhost
psql -d testdb -U testuser -c "insert into bar(name, description, id) values('Raku','Programming Language', 42)" -h localhost
[35m02:56:03[0m :: [repository] - index updated from https://sparrowhub.io/repo/api/v1/index
run stage: run
[1;36m[task run: task.bash - tasks/install][0m
[1;36m[dump code: task.bash][0m
[1] set -e
[2] cd source/
[3] zef install . --/test
[4]
[1;36m[task stdout][0m
[35m02:56:08[0m :: ===> Searching for missing dependencies: Auth::SCRAM::Async
[35m02:56:36[0m :: ===> Searching for missing dependencies: Crypt::Random
[35m02:56:36[0m :: ===> Searching for missing dependencies: if
[35m02:56:36[0m :: ===> Installing: if:ver<0.1.1>
[35m02:56:36[0m :: ===> Installing: Crypt::Random:ver<0.4.1>
[35m02:56:36[0m :: ===> Installing: Auth::SCRAM::Async:ver<0.0.1>:auth<cpan:LEONT>
[35m02:56:36[0m :: ===> Installing: Protocol::Postgres:ver<0.0.3>:auth<cpan:LEONT>
[1;36m[task stderr][0m
[35m02:56:36[0m :: ===> Updating fez mirror: https://360.zef.pm/
[35m02:56:36[0m :: ===> Updated fez mirror: https://360.zef.pm/
[35m02:56:36[0m :: ===> Updating rea mirror: https://raw.githubusercontent.com/Raku/REA/main/META.json
[35m02:56:36[0m :: ===> Updated rea mirror: https://raw.githubusercontent.com/Raku/REA/main/META.json
[35m02:56:15[0m :: [repository] - index updated from https://sparrowhub.io/repo/api/v1/index
run stage: run
[35m02:56:18[0m :: [repository] - installing sparkyci-service-postgresql, version 0.000012
[1;36m[task run: task.bash - install-pg][0m
[1;36m[dump code: task.bash][0m
[1] set -e
[2]
[3] db_user=$(config db_user)
[4] db_pass=$(config db_pass)
[5] db_name=$(config db_name)
[6]
[7] set -x
[8]
[9] 2>&1
[10]
[11] echo "installing postgresql service on sparky"
[12] echo "======================================="
[13]
[14]
[15] sudo apk add postgresql
[16]
[17] sudo mkdir -p /run/postgresql
[18]
[19] sudo chown postgres:postgres /run/postgresql
[20]
[21] sudo rm -rf /var/lib/postgresql/data
[22]
[23] sudo mkdir -p /var/lib/postgresql/data
[24]
[25] sudo chown postgres:postgres /var/lib/postgresql/data
[26]
[27] sudo chmod 0700 /var/lib/postgresql/data
[28]
[29] sudo -u postgres sh -c -l 'initdb -D /var/lib/postgresql/data'
[30]
[31] sudo -u postgres sh -c -l 'postgres -D /var/lib/postgresql/data >/var/lib/postgresql/logfile 2>&1 &'
[32]
[33] sleep 5
[34]
[35] sudo -u postgres psql -c "create user $db_user with password '$db_pass'"
[36] sudo -u postgres sh -l -c "createdb $db_name"
[37] sudo -u postgres psql -c "grant all privileges on database $db_name to $db_user;"
[38]
[39] export PGPASSWORD=$db_pass
[40]
[41] psql -d $db_name -U $db_user -c "create table foo(a text)" -h localhost
[42]
[43]
[1;36m[task stdout][0m
[35m02:56:21[0m :: installing postgresql service on sparky
[35m02:56:21[0m :: =======================================
[35m02:56:21[0m :: fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
[35m02:56:21[0m :: fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
[35m02:56:21[0m :: fetch https://dl.cloudsmith.io/public/nxadm-pkgs/rakudo-pkg/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
[35m02:56:22[0m :: (1/12) Installing postgresql-common (1.1-r2)
[35m02:56:22[0m :: Executing postgresql-common-1.1-r2.pre-install
[35m02:56:22[0m :: (2/12) Installing libpq (14.5-r0)
[35m02:56:22[0m :: (3/12) Installing postgresql14-client (14.5-r0)
[35m02:56:22[0m :: (4/12) Installing tzdata (2022f-r1)
[35m02:56:22[0m :: (5/12) Installing icu-data-en (71.1-r2)
[35m02:56:22[0m :: Executing icu-data-en-71.1-r2.post-install
[35m02:56:22[0m :: (6/12) Installing icu-libs (71.1-r2)
[35m02:56:22[0m :: (7/12) Installing gdbm (1.23-r0)
[35m02:56:22[0m :: (8/12) Installing libsasl (2.1.28-r1)
[35m02:56:22[0m :: (9/12) Installing libldap (2.6.3-r3)
[35m02:56:22[0m :: (10/12) Installing xz-libs (5.2.5-r1)
[35m02:56:22[0m :: (11/12) Installing libxml2 (2.9.14-r2)
[35m02:56:22[0m :: (12/12) Installing postgresql14 (14.5-r0)
[35m02:56:22[0m :: Executing postgresql14-14.5-r0.post-install
[35m02:56:22[0m :: Executing busybox-1.35.0-r17.trigger
[35m02:56:22[0m :: Executing postgresql-common-1.1-r2.trigger
[35m02:56:23[0m :: OK: 739 MiB in 72 packages
[35m02:56:23[0m :: The files belonging to this database system will be owned by user "postgres".
[35m02:56:23[0m :: This user must also own the server process.
[35m02:56:23[0m ::
[35m02:56:23[0m :: The database cluster will be initialized with locales
[35m02:56:23[0m :: COLLATE: C
[35m02:56:23[0m :: CTYPE: C.UTF-8
[35m02:56:23[0m :: MESSAGES: C
[35m02:56:23[0m :: MONETARY: C
[35m02:56:23[0m :: NUMERIC: C
[35m02:56:23[0m :: TIME: C
[35m02:56:23[0m :: The default database encoding has accordingly been set to "UTF8".
[35m02:56:23[0m :: The default text search configuration will be set to "english".
[35m02:56:23[0m ::
[35m02:56:23[0m :: Data page checksums are disabled.
[35m02:56:23[0m ::
[35m02:56:23[0m :: fixing permissions on existing directory /var/lib/postgresql/data ... ok
[35m02:56:23[0m :: creating subdirectories ... ok
[35m02:56:23[0m :: selecting dynamic shared memory implementation ... posix
[35m02:56:23[0m :: selecting default max_connections ... 100
[35m02:56:23[0m :: selecting default shared_buffers ... 128MB
[35m02:56:23[0m :: selecting default time zone ... UTC
[35m02:56:23[0m :: creating configuration files ... ok
[35m02:56:24[0m :: running bootstrap script ... ok
[35m02:56:25[0m :: performing post-bootstrap initialization ... ok
[35m02:56:25[0m :: syncing data to disk ... ok
[35m02:56:25[0m ::
[35m02:56:25[0m ::
[35m02:56:25[0m :: Success.
[35m02:56:25[0m ::
[35m02:56:30[0m :: CREATE ROLE
[35m02:56:31[0m :: GRANT
[35m02:56:31[0m :: CREATE TABLE
[1;36m[task stderr][0m
[35m02:56:31[0m :: ++ echo 'installing postgresql service on sparky'
[35m02:56:31[0m :: ++ echo =======================================
[35m02:56:31[0m :: ++ sudo apk add postgresql
[35m02:56:31[0m :: *
[35m02:56:31[0m :: * If you need ICU with non-English locales and legacy charset support, install
[35m02:56:31[0m :: * package icu-data-full.
[35m02:56:31[0m :: *
[35m02:56:31[0m :: *
[35m02:56:31[0m :: * If you want to use JIT in PostgreSQL, install postgresql14-jit or
[35m02:56:31[0m :: * postgresql-jit (if you didn't install specific major version of postgresql).
[35m02:56:31[0m :: *
[35m02:56:31[0m :: * Setting postgresql14 as the default version
[35m02:56:31[0m :: ++ sudo mkdir -p /run/postgresql
[35m02:56:31[0m :: ++ sudo chown postgres:postgres /run/postgresql
[35m02:56:31[0m :: ++ sudo rm -rf /var/lib/postgresql/data
[35m02:56:31[0m :: ++ sudo mkdir -p /var/lib/postgresql/data
[35m02:56:31[0m :: ++ sudo chown postgres:postgres /var/lib/postgresql/data
[35m02:56:31[0m :: ++ sudo chmod 0700 /var/lib/postgresql/data
[35m02:56:31[0m :: ++ sudo -u postgres sh -c -l 'initdb -D /var/lib/postgresql/data'
[35m02:56:31[0m :: initdb: warning: enabling "trust" authentication for local connections
[35m02:56:31[0m :: You can change this by editing pg_hba.conf or using the option -A, or
[35m02:56:31[0m :: --auth-local and --auth-host, the next time you run initdb.
[35m02:56:31[0m :: ++ sudo -u postgres sh -c -l 'postgres -D /var/lib/postgresql/data >/var/lib/postgresql/logfile 2>&1 &'
[35m02:56:31[0m :: ++ sleep 5
[35m02:56:31[0m :: ++ sudo -u postgres psql -c 'create user testuser with password '\''testpass'\'''
[35m02:56:31[0m :: ++ sudo -u postgres sh -l -c 'createdb testdb'
[35m02:56:31[0m :: ++ sudo -u postgres psql -c 'grant all privileges on database testdb to testuser;'
[35m02:56:31[0m :: ++ export PGPASSWORD=testpass
[35m02:56:31[0m :: ++ PGPASSWORD=testpass
[35m02:56:31[0m :: ++ psql -d testdb -U testuser -c 'create table foo(a text)' -h localhost
[35m02:56:49[0m :: [repository] - index updated from https://sparrowhub.io/repo/api/v1/index
run stage: run
[1;36m[task run: task.bash - tasks/create-table][0m
[1;36m[dump code: task.bash][0m
[1] set -e
[2] export PGPASSWORD=testpass
[3] psql -d testdb -U testuser -c "create table bar(name text, description text, id int)" -h localhost
[4] psql -d testdb -U testuser -c "insert into bar(name, description, id) values('Raku','Programming Language', 42)" -h localhost
[5]
[1;36m[task stdout][0m
[35m02:56:52[0m :: CREATE TABLE
[35m02:56:52[0m :: INSERT 0 1
[35m02:55:37[0m :: [repository] - index updated from https://sparrowhub.io/repo/api/v1/index
run stage: run
source directory does not yet exist, download source archive from storage
[35m02:55:40[0m :: [repository] - installing pack-unpack, version 0.000001
[1;36m[task run: task.bash - unpack source archive][0m
[1;36m[dump code: task.bash][0m
[1] set -e
[2]
[3] file=$(config file)
[4] dir=$(config dir)
[5]
[6] echo "tar -xzf $file "
[7]
[8] tar -xzf $file
[9]
[10] if test $dir; then
[11] ls -l $dir
[12] fi
[13]
[14]
[1;36m[task stdout][0m
[35m02:55:43[0m :: tar -xzf source.tar.gz
[1;36m[task run: task.raku - tasks/int-test][0m
[1;36m[dump code: task.raku][0m
[1] use v6.d;
[2] use Protocol::Postgres;
[3]
[4] my $socket = await IO::Socket::Async.connect("localhost",5432);
[5] my $client = Protocol::Postgres::Client.new;
[6] $socket.Supply(:bin).act({ $client.incoming-data($^data) });
[7] $client.outbound-data.act({ $socket.write($^data) });
[8]
[9] await $client.startup("testuser", "testdb", "testpass");
[10]
[11] my $resultset = await $client.query('SELECT * FROM bar WHERE id = $1', 42);
[12] react {
[13] whenever $resultset.hash-rows -> (:$name, :$description) {
[14] say "$name is $description";
[15] }
[16] }
[17]
[1;36m[task stdout][0m
[1;36m[task stderr][0m
[35m02:57:03[0m :: A react block:
[35m02:57:03[0m :: in block <unit> at /var/.sparrowdo/env/int-test/.sparrowdo/tasks/int-test/task.raku line 12
[35m02:57:03[0m ::
[35m02:57:03[0m :: Died because of the exception:
[35m02:57:03[0m :: Unexpected named argument 'id' passed in sub-signature
[35m02:57:03[0m :: in block at /var/.sparrowdo/env/int-test/.sparrowdo/tasks/int-test/task.raku line 13
[35m02:57:03[0m :: in method add-row at /home/worker/.raku/sources/4ABF3661E73A0A176F3A6DC0D272BA3FF21FF959 (Protocol::Postgres) line 1008
[35m02:57:03[0m :: in method incoming-message at /home/worker/.raku/sources/4ABF3661E73A0A176F3A6DC0D272BA3FF21FF959 (Protocol::Postgres) line 1054
[35m02:57:03[0m :: in method incoming-message at /home/worker/.raku/sources/4ABF3661E73A0A176F3A6DC0D272BA3FF21FF959 (Protocol::Postgres) line 1314
[35m02:57:03[0m :: in method incoming-data at /home/worker/.raku/sources/4ABF3661E73A0A176F3A6DC0D272BA3FF21FF959 (Protocol::Postgres) line 1284
[35m02:57:03[0m :: in block at /var/.sparrowdo/env/int-test/.sparrowdo/tasks/int-test/task.raku line 6
[35m02:57:03[0m ::
[35m02:57:03[0m :: task exit status: 1
[35m02:57:03[0m :: task tasks/int-test FAILED
The spawned command 'docker exec -i sparrow-worker sh -l /var/.sparrowdo/env/int-test/.sparrowdo/sparrowrun.sh' exited unsuccessfully (exit code: 1, signal: 0)
in block <unit> at /home/sph/.raku/resources/57C38AFDF922EB0C43584FF5F701A03850B5346F line 13
in sub MAIN at /home/sph/.raku/bin/sparrowdo line 3
in block <unit> at /home/sph/.raku/bin/sparrowdo line 1