Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Attempt to revive Travis.#53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
sokolcati wants to merge2 commits intopostgrespro:master
base:master
Choose a base branch
Loading
fromsokolcati:master
Open
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
NextNext commit
Attempt to revive Travis.
  • Loading branch information
Ekaterina Sokolova committedJul 5, 2024
commitb57b1acac09c927d75a92352831900946cea2ee4
1 change: 1 addition & 0 deletions.gitignore
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@
/log/
/results/
/tmp_check/
*.bc
*.so
*.o
jsquery_gram.c
Expand Down
56 changes: 27 additions & 29 deletions.travis.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
os:
- linux

sudo: required
dist: trusty
dist: jammy

language: c

compiler:
- clang
- gcc
env:
- PG_VER=16
- PG_VER=15
- PG_VER=14
- PG_VER=13
- PG_VER=12
- PG_VER=11
- PG_VER=10
- PG_VER=9.6
- PG_VER=9.5
- PG_VER=9.4

before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -y install -qq wget ca-certificates; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then source ./travis/dep-ubuntu-postgres.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then source ./travis/dep-ubuntu-llvm.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq; fi
jobs:
allow_failures:
- env: PG_VER=12
- env: PG_VER=11
- env: PG_VER=10
- env: PG_VER=9.6
- env: PG_VER=9.5
- env: PG_VER=9.4

env:
global:
- LLVM_VER=4.0
matrix:
- PG_VER=11 CHECK_TYPE=normal
- PG_VER=11 CHECK_TYPE=static
- PG_VER=10 CHECK_TYPE=normal
- PG_VER=10 CHECK_TYPE=static
- PG_VER=10.5 CHECK_TYPE=valgrind
- PG_VER=9.6 CHECK_TYPE=normal
- PG_VER=9.6 CHECK_TYPE=static
- PG_VER=9.5 CHECK_TYPE=normal
- PG_VER=9.5 CHECK_TYPE=static
- PG_VER=9.4 CHECK_TYPE=normal
- PG_VER=9.4 CHECK_TYPE=static
before_script:
- sudo apt-get -y install -qq wget ca-certificates
- travis/dep-ubuntu-postgres.sh
- sudo apt-get update
- sudo apt-get install -y --no-install-recommends postgresql-client-${PG_VER} postgresql-${PG_VER} postgresql-server-dev-${PG_VER}
- sudo systemctl stop postgresql

script:bash ./travis/pg-travis-test.sh
script: travis/pg-travis-test.sh
2 changes: 1 addition & 1 deletionREADME.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/postgrespro/jsquery.svg?branch=master)](https://travis-ci.org/postgrespro/jsquery)
[![Build Status](https://app.travis-ci.com/postgrespro/jsquery.svg?branch=master)](https://app.travis-ci.com/postgrespro/jsquery)
[![codecov](https://codecov.io/gh/postgrespro/jsquery/branch/master/graph/badge.svg)](https://codecov.io/gh/postgrespro/jsquery)
[![GitHub license](https://img.shields.io/badge/license-PostgreSQL-blue.svg)](https://raw.githubusercontent.com/postgrespro/jsquery/master/LICENSE)

Expand Down
4 changes: 0 additions & 4 deletionstravis/dep-ubuntu-llvm.sh
View file
Open in desktop

This file was deleted.

4 changes: 2 additions & 2 deletionstravis/dep-ubuntu-postgres.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
#!/bin/sh

cat ./travis/postgresql.gpg.key |sudoapt-key add -
echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main $PG_VER" | sudo tee /etc/apt/sources.list.d/pgdg.list
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc|sudogpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
echo "deb http://apt-archive.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main $PG_VER"
52 changes: 0 additions & 52 deletionstravis/llvm-snapshot.gpg.key
View file
Open in desktop

This file was deleted.

200 changes: 14 additions & 186 deletionstravis/pg-travis-test.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,193 +1,21 @@
#!/bin/bash
set -ev

set -eux
export PATH=/usr/lib/postgresql/$PG_VER/bin:$PATH
export PGDATA=/var/lib/postgresql/$PG_VER/test
export COPT=-Werror
export USE_PGXS=1

echo -en 'travis_fold:start:pg_install\\r' && echo 'PostgreSQL installation'
sudo chmod 1777 /var/lib/postgresql/$PG_VER
sudo chmod 1777 /var/run/postgresql

sudo apt-get update
make clean
make

# bug: http://www.postgresql.org/message-id/20130508192711.GA9243@msgid.df7cb.de
sudo update-alternatives --remove-all postmaster.1.gz
sudo -E env PATH=$PATH make install

# stop all existing instances (because of https://github.com/travis-ci/travis-cookbooks/pull/221)
sudo service postgresql stop
# ... and make sure they don't come back
echo 'exit 0' | sudo tee /etc/init.d/postgresql
sudo chmod a+x /etc/init.d/postgresql
/usr/lib/postgresql/$PG_VER/bin/initdb

# install PostgreSQL
if [ $CHECK_TYPE = "valgrind" ]; then
# install required packages
apt_packages="build-essential libgd-dev valgrind lcov"
sudo apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y install -qq $apt_packages

set -e

pushd ~
CUSTOM_PG_BIN=$PWD/pg_bin
CUSTOM_PG_SRC=$PWD/postgresql

curl "https://ftp.postgresql.org/pub/source/v$PG_VER/postgresql-$PG_VER.tar.bz2" -o postgresql.tar.bz2
mkdir $CUSTOM_PG_SRC

tar \
--extract \
--file postgresql.tar.bz2 \
--directory $CUSTOM_PG_SRC \
--strip-components 1

cd $CUSTOM_PG_SRC

# enable Valgrind support
sed -i.bak "s/\/* #define USE_VALGRIND *\//#define USE_VALGRIND/g" src/include/pg_config_manual.h

# enable additional options
./configure \
CFLAGS='-Og -ggdb3 -fno-omit-frame-pointer' \
--enable-cassert \
--enable-coverage \
--prefix=$CUSTOM_PG_BIN \
--quiet

# build & install PG
time make -s -j4 && make -s install

# override default PostgreSQL instance
export PATH=$CUSTOM_PG_BIN/bin:$PATH
export LD_LIBRARY_PATH=$CUSTOM_PG_BIN/lib

popd
set +e
prefix=$CUSTOM_PG_BIN
else
apt_packages="postgresql-$PG_VER postgresql-server-dev-$PG_VER postgresql-common build-essential libgd-dev"
sudo apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y install -qq $apt_packages
prefix=/usr/lib/postgresql/$PG_VER
fi

# config path
pg_ctl_path=$prefix/bin/pg_ctl
initdb_path=$prefix/bin/initdb
config_path=$prefix/bin/pg_config

# exit code
status=0

echo -en 'travis_fold:end:pg_install\\r'

# perform code analysis if necessary
if [ $CHECK_TYPE = "static" ]; then
echo -en 'travis_fold:start:static_analysis\\r' && echo 'Static analysis'

if [ "$CC" = "clang" ]; then
sudo apt-get -y install -qq clang-$LLVM_VER

scan-build-$LLVM_VER --status-bugs \
-disable-checker deadcode.DeadStores \
make USE_PGXS=1 USE_ASSERT_CHECKING=1 PG_CONFIG=$config_path || status=$?

elif [ "$CC" = "gcc" ]; then
sudo apt-get -y install -qq cppcheck

cppcheck --template "{file} ({line}): {severity} ({id}): {message}" \
--enable=warning,portability,performance \
--suppress=redundantAssignment \
--suppress=uselessAssignmentPtrArg \
--suppress=incorrectStringBooleanError \
--std=c89 *.c *.h 2> cppcheck.log

if [ -s cppcheck.log ]; then
cat cppcheck.log
status=1 # error
fi
fi

# don't forget to "make clean"
make clean USE_PGXS=1 PG_CONFIG=$config_path
echo -en 'travis_fold:end:static_analysis\\r'
exit $status
fi

echo -en 'travis_fold:start:build_extension\\r' && echo 'Build extension'

# build extension (using CFLAGS_SL for gcov)
if [ $CHECK_TYPE == "valgrind" ]; then
make USE_PGXS=1 USE_ASSERT_CHECKING=1 PG_CONFIG=$config_path
make install USE_PGXS=1 PG_CONFIG=$config_path
else
make USE_PGXS=1 USE_ASSERT_CHECKING=1 CC=$CC PG_CONFIG=$config_path CFLAGS_SL="$($config_path --cflags_sl) -coverage"
sudo make install USE_PGXS=1 PG_CONFIG=$config_path
fi

echo -en 'travis_fold:end:build_extension\\r'

echo -en 'travis_fold:start:run_tests\\r' && echo 'Run tests'

# enable core dumps and specify their path
ulimit -c unlimited -S
echo '/tmp/%e-%s-%p.core' | sudo tee /proc/sys/kernel/core_pattern

# set permission to write postgres locks
sudo chown $USER /var/run/postgresql/

# create cluster 'test'
CLUSTER_PATH=$(pwd)/test_cluster
$initdb_path -D $CLUSTER_PATH -U $USER -A trust

# start cluster 'test'
echo "port = 55435" >> $CLUSTER_PATH/postgresql.conf
if [ $CHECK_TYPE = "valgrind" ]; then
PGCTLTIMEOUT=600 \
valgrind --leak-check=no --gen-suppressions=all \
--suppressions=$CUSTOM_PG_SRC/src/tools/valgrind.supp --time-stamp=yes \
--log-file=/tmp/pid-%p.log --trace-children=yes \
$pg_ctl_path -D $CLUSTER_PATH start -l postgres.log -w
else
$pg_ctl_path -D $CLUSTER_PATH start -l postgres.log -w
fi

# run regression tests
PGPORT=55435 PGUSER=$USER PG_CONFIG=$config_path make installcheck USE_PGXS=1 || status=$?

# stop cluster
$pg_ctl_path -D $CLUSTER_PATH stop -l postgres.log -w

echo -en 'travis_fold:end:run_tests\\r'

echo -en 'travis_fold:start:output\\r' && echo 'Check output'

# show diff if it exists
if test -f regression.diffs; then cat regression.diffs; fi

# show valgrind logs if needed
if [ $CHECK_TYPE = "valgrind" ]; then
for f in ` find /tmp -name pid-*.log ` ; do
if grep -q 'Command: [^ ]*/postgres' $f && grep -q 'ERROR SUMMARY: [1-9]' $f; then
echo "========= Contents of $f"
cat $f
status=1
fi
done
fi

# check core dumps if any
for corefile in $(find /tmp/ -name '*.core' 2>/dev/null) ; do
binary=$(gdb -quiet -core $corefile -batch -ex 'info auxv' | grep AT_EXECFN | perl -pe "s/^.*\"(.*)\"\$/\$1/g")
echo dumping $corefile for $binary
gdb --batch --quiet -ex "thread apply all bt full" -ex "quit" $binary $corefile
done

echo -en 'travis_fold:end:output\\r'

echo -en 'travis_fold:start:coverage\\r' && echo 'Coverage check'

#generate *.gcov files
if [ $CC = "clang" ]; then
bash <(curl -s https://codecov.io/bash) -x "llvm-cov gcov"
else
bash <(curl -s https://codecov.io/bash)
fi

echo -en 'travis_fold:end:coverage\\r'

exit $status
/usr/lib/postgresql/$PG_VER/bin/pg_ctl -l logfile start
make installcheck
/usr/lib/postgresql/$PG_VER/bin/pg_ctl stop
Loading

[8]ページ先頭

©2009-2025 Movatter.jp