Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
cb60059
fix issue
andarut Apr 7, 2023
7e137cb
move kphp-timelib installation to the top and add explanatory comment
andarut Apr 20, 2023
8ffd6b6
fix gh for mac os, try fix for linux without changing version of urllib
andarut May 24, 2023
3f12034
fix urllib and requests-toolbelt versions
andarut May 24, 2023
f5a7642
try different config
andarut May 24, 2023
65cd7e6
try fix bad stats line
andarut May 24, 2023
7047c35
try fix bad stats line
andarut May 25, 2023
7ab113e
try fix bad stats line
andarut May 25, 2023
3c439c1
fix stackoverflow error handle
andarut May 25, 2023
cd0d57f
Revert "move kphp-timelib installation to the top and add explanatory…
andarut May 25, 2023
b2320f2
debug stats file lines
andarut May 25, 2023
f8257e3
Revert "fix issue"
andarut May 26, 2023
4770c1d
len of stats file always lower than older stats
andarut May 26, 2023
6df0401
install from requirements
andarut May 26, 2023
af5a260
const python package versions
andarut May 26, 2023
138435c
fix pytest-mysql version
andarut May 26, 2023
cd2ec49
Delete test.txt
andarut May 30, 2023
ee0e2a7
try macos target with 12 cores, to check for slow syscalls
andarut Jun 2, 2023
2238261
Merge branch 'fix' of https://github.com/andreylzmw/kphp into fix
andarut Jun 2, 2023
5211b1a
Merge branch 'master' into fix
andarut Jun 2, 2023
7e711f7
test failed unit test on 3-core github actions runner, but now we are…
andarut Jun 23, 2023
794fd74
run only mac os
andarut Jun 23, 2023
520a0b9
try 3 cores
andarut Jun 23, 2023
38ab436
test on 12 cores
andarut Jun 24, 2023
3b43bbc
install python packages inside docker
Jul 3, 2023
b7b10d3
try with copy
Jul 3, 2023
915793b
reqs not from parent directories
andarut Jul 3, 2023
cf98f7a
GITHUB_WORKFLOW path?
andarut Jul 3, 2023
76bfce3
try without copy
andarut Jul 3, 2023
85e6fba
try without copy back
andarut Jul 3, 2023
eb265cd
try without copy back
andarut Jul 3, 2023
98e6574
mysql-dev fix
andarut Jul 3, 2023
f9d5c25
try fix pkg-config
andarut Jul 3, 2023
9445249
try fix pkg-config
andarut Jul 3, 2023
97a82fa
try add reqs to hash
andarut Jul 3, 2023
92c24b5
try fix brew cask fetch error
andarut Jul 3, 2023
41e81ff
try hash with reqs
andarut Jul 3, 2023
6e69feb
try fix mac os homebrew
andarut Jul 4, 2023
91e5e60
fix mac os build with homebrew fetch error
andarut Jul 4, 2023
5483ee6
add jsonschema and setuptools to python reqs
andarut Jul 5, 2023
322ce35
wrong req file
andarut Jul 5, 2023
701568c
remove brackets
andarut Jul 5, 2023
f2a9a6b
back to mac os brew fetch error
andarut Jul 5, 2023
a901ff8
fix jsonschema versoin
andarut Jul 5, 2023
916a89e
try mac os homebrew fetch error fix
andarut Jul 5, 2023
6dc1a9c
fix mysql installing
andarut Jul 5, 2023
4b8f0b0
fix mysql python installing
andarut Jul 5, 2023
bb49ce1
try fix mac os brew fetch error
andarut Jul 5, 2023
68a7680
move setuptools back in dockerfiles
andarut Jul 5, 2023
b281616
back mysql apt before mysql python
andarut Jul 5, 2023
c4142dd
back mysql apt before mysql python
andarut Jul 5, 2023
6e6eaf3
back mysql apt before mysql python
andarut Jul 5, 2023
1c09e13
run only macos
andarut Jul 5, 2023
2759781
try fix mac os homebrew fetch error
andarut Jul 5, 2023
e6f6603
try fix mac os homebrew fetch error
andarut Jul 5, 2023
13b5c5f
try fix mac os homebrew fetch error
andarut Jul 5, 2023
95ec039
try fix mac os homebrew fetch error
andarut Jul 5, 2023
1173c8f
try fix timeout error when running unittests and gets timeout
andarut Jul 5, 2023
94482c3
restore linux builds
andarut Jul 5, 2023
8c0c784
restore linux builds
andarut Jul 5, 2023
015b429
try without pkg-config
andarut Jul 5, 2023
d31cd57
pkg-config for building wheel
andarut Jul 5, 2023
f548c92
fix link
andarut Jul 5, 2023
b406cf1
back to old error message
andarut Jul 5, 2023
7779f52
restore error text
andarut Jul 5, 2023
3cd4488
format
andarut Jul 5, 2023
cee1e45
format python formula
andarut Jul 5, 2023
f40e39a
ignore timeout
andarut Jul 6, 2023
378e922
ignore timeout
andarut Jul 6, 2023
39ad499
try flacky test without profiler
andarut Jul 7, 2023
6f9d602
fix timeout key and try with profiler
andarut Jul 7, 2023
34ebca9
try profiler 1
andarut Jul 7, 2023
0850378
back mac os disabled test and try with profiler 2
andarut Jul 7, 2023
c03d49a
remove profiler
andarut Jul 7, 2023
38b643f
try with python3.7
andarut Jul 12, 2023
e5fcbc2
run python tests with python 3.7
andarut Jul 12, 2023
2b79ab8
try with python > 3.7
andarut Jul 13, 2023
99b2d39
return to python 3.7
andarut Jul 13, 2023
a84c928
remove test
andarut Jul 13, 2023
ac5fed1
Merge branch 'master' of https://github.com/VKCOM/kphp
andarut Jul 13, 2023
8ed31d7
Merge branch 'master' into fix
andarut Jul 13, 2023
b1368f9
remove test
andarut Jul 14, 2023
2dc908c
profiler back to 2
andarut Jul 14, 2023
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
30 changes: 29 additions & 1 deletion .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: true
HOMEBREW_NO_INSTALL_FROM_API: ""
kphp_root_dir: /home/kitten/kphp
kphp_polyfills_dir: /home/kitten/kphp/kphp-polyfills
kphp_build_dir: /home/kitten/kphp/build
Expand Down Expand Up @@ -54,7 +55,7 @@ jobs:
id: docker-image-cache
with:
path: kphp-build-env-${{matrix.os}}.tar
key: docker-image-cache-${{matrix.os}}-${{ hashFiles('.github/workflows/Dockerfile.*') }}
key: docker-image-cache-${{matrix.os}}-${{ hashFiles('.github/workflows/Dockerfile.*', 'tests/python/requirements.txt') }}

- name: Build and save docker image
if: steps.docker-image-cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -91,6 +92,27 @@ jobs:
run: docker exec kphp-build-container-${{matrix.os}} bash -c
"composer install -d ${{env.kphp_polyfills_dir}}"

- name: Run python tests
id: python_tests
continue-on-error: true
run: docker exec kphp-build-container-${{matrix.os}} bash -c
"chown -R kitten /home && su kitten -c 'GITHUB_ACTIONS=1 KPHP_TESTS_POLYFILLS_REPO=${{env.kphp_polyfills_dir}} KPHP_CXX=${{matrix.compiler}} python3.7 -m pytest --tb=native -n$(nproc) ${{env.kphp_root_dir}}/tests/python/'"

- name: Prepare python tests artifacts
if: steps.python_tests.outcome == 'failure'
run: docker cp kphp-build-container-${{matrix.os}}:${{env.kphp_root_dir}}/tests/python/_tmp/ ${{runner.temp}} &&
rm -rf ${{runner.temp}}/_tmp/*/working_dir

- name: Upload python tests artifacts
uses: actions/upload-artifact@v3
if: steps.python_tests.outcome == 'failure'
with:
path: ${{runner.temp}}/_tmp/

- name: Fail pipeline if python tests failed
if: steps.python_tests.outcome == 'failure'
run: exit 1

- name: Remove docker container
run: docker rm -f kphp-build-container-${{matrix.os}}

Expand All @@ -115,6 +137,12 @@ jobs:
path: 'h3'
ref: stable-3.x

# because of https://github.com/orgs/Homebrew/discussions/4612
- name: Check Environment
run: |
export HOMEBREW_NO_INSTALL_FROM_API=0
brew untap --force homebrew/cask

- name: Setup Environment
run: |
brew tap shivammathur/php
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/Dockerfile.buster
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM debian:buster
ARG DEBIAN_FRONTEND=noninteractive

COPY tests/python/requirements.txt /tmp/

RUN apt-get update && \
apt-get install -y --no-install-recommends apt-utils ca-certificates gnupg wget lsb-release && \
echo "deb https://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list && \
Expand All @@ -17,12 +19,11 @@ RUN apt-get update && \
apt-get update && \
apt-get install -y --no-install-recommends \
git cmake-data=3.18* cmake=3.18* make g++ gperf netcat \
python3-minimal python3-dev libpython3-dev python3-jsonschema python3-setuptools python3-pip && \
pip3 install wheel && \
python3.7 python3-dev libpython3-dev python3-pip python3-setuptools mysql-server libmysqlclient-dev && \
pip3 install -r /tmp/requirements.txt && \
apt-get install -y --no-install-recommends curl-kphp-vk kphp-timelib libuber-h3-dev libfmt-dev libgtest-dev libgmock-dev libre2-dev libpcre3-dev \
libzstd-dev libyaml-cpp-dev libnghttp2-dev zlib1g-dev php7.4-dev mysql-server libmysqlclient-dev libldap-dev libkrb5-dev \
libzstd-dev libyaml-cpp-dev libnghttp2-dev zlib1g-dev php7.4-dev libldap-dev libkrb5-dev \
postgresql postgresql-server-dev-all libnuma-dev composer && \
pip3 install portalocker psutil requests-toolbelt pytest pytest-xdist pytest-mysql pytest-postgresql psycopg zstandard && \
rm -rf /var/lib/apt/lists/* && \
update-alternatives --set php /usr/bin/php7.4

Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/Dockerfile.focal
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive

COPY tests/python/requirements.txt /tmp/

RUN apt-get update && \
apt-get install -y --no-install-recommends apt-utils ca-certificates gnupg wget && \
apt-get install -y --no-install-recommends apt-utils ca-certificates gnupg wget pkg-config software-properties-common && \
wget -qO /etc/apt/trusted.gpg.d/vkpartner.asc https://artifactory-external.vkpartner.ru/artifactory/api/gpg/key/public && \
echo "deb https://artifactory-external.vkpartner.ru/artifactory/kphp focal main" >> /etc/apt/sources.list && \
echo "deb http://apt.postgresql.org/pub/repos/apt focal-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y --no-install-recommends \
git cmake make clang g++ g++-10 gperf netcat \
python3-minimal python3-dev libpython3-dev python3-jsonschema python3-setuptools python3-pip && \
pip3 install wheel && \
python3.7 python3-pip python3.7-distutils python3.7-dev libpython3.7-dev python3-jsonschema python3-setuptools mysql-server libmysqlclient-dev && \
python3.7 -m pip install pip && python3.7 -m pip install -r /tmp/requirements.txt && \
apt-get install -y --no-install-recommends curl-kphp-vk kphp-timelib libuber-h3-dev libfmt-dev libgtest-dev libgmock-dev libre2-dev libpcre3-dev \
libzstd-dev libyaml-cpp-dev libnghttp2-dev zlib1g-dev php7.4-dev mysql-server libmysqlclient-dev libldap-dev libkrb5-dev \
libzstd-dev libyaml-cpp-dev libnghttp2-dev zlib1g-dev php7.4-dev libldap-dev libkrb5-dev \
postgresql postgresql-server-dev-all libnuma-dev composer unzip && \
pip3 install portalocker psutil requests-toolbelt pytest pytest-xdist pytest-mysql pytest-postgresql psycopg zstandard && \
rm -rf /var/lib/apt/lists/*

ENV ASAN_OPTIONS=detect_leaks=0
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/Dockerfile.jammy
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive

COPY tests/python/requirements.txt /tmp/

# package software-properties-common, repo ppa:ondrej/php are only required for installing
# php 7.4 on ubuntu 22, where default php version is 8.1

RUN apt update && \
apt install -y --no-install-recommends apt-utils ca-certificates gnupg wget software-properties-common && \
apt install -y --no-install-recommends apt-utils ca-certificates gnupg wget software-properties-common pkg-config && \
wget -qO /etc/apt/trusted.gpg.d/vkpartner.asc https://artifactory-external.vkpartner.ru/artifactory/api/gpg/key/public && \
echo "deb https://artifactory-external.vkpartner.ru/artifactory/kphp jammy main" >> /etc/apt/sources.list && \
add-apt-repository ppa:ondrej/php -y && \
add-apt-repository ppa:deadsnakes/ppa && \
apt update && \
apt install -y --no-install-recommends \
git cmake make g++ lld gperf netcat \
python3-minimal python3-dev libpython3-dev python3-jsonschema python3-setuptools python3-pip && \
pip3 install wheel && \
python3.7 python3-pip python3.7-distutils python3.7-dev libpython3.7-dev python3-jsonschema python3-setuptools mysql-server libmysqlclient-dev && \
python3.7 -m pip install pip && python3.7 -m pip install -r /tmp/requirements.txt && \
apt install -y --no-install-recommends curl-kphp-vk kphp-timelib libuber-h3-dev libfmt-dev libgtest-dev libgmock-dev libre2-dev libpcre3-dev \
libzstd-dev libyaml-cpp-dev libnghttp2-dev zlib1g-dev php7.4-dev mysql-server libmysqlclient-dev libnuma-dev unzip \
libzstd-dev libyaml-cpp-dev libnghttp2-dev zlib1g-dev php7.4-dev libnuma-dev unzip \
libldap-dev libkrb5-dev postgresql postgresql-server-dev-all && \
pip3 install portalocker psutil requests-toolbelt pytest pytest-xdist pytest-mysql pytest-postgresql psycopg zstandard && \
rm -rf /var/lib/apt/lists/*

# set php7.4 as default
Expand Down
3 changes: 3 additions & 0 deletions common/parallel/counter-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <gtest/gtest.h>

#if !defined(__APPLE__)

TEST(parallel_counter, basic) {
PARALLEL_COUNTER(counter);
Expand Down Expand Up @@ -43,6 +44,8 @@ TEST(parallel_counter, basic) {
EXPECT_EQ(expected_sum, PARALLEL_COUNTER_READ(counter));
}

#endif

TEST(parallel_counter, inc_and_dec) {
PARALLEL_COUNTER(counter);

Expand Down
4 changes: 2 additions & 2 deletions common/parallel/limit-counter-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#include "common/parallel/limit-counter.h"

#if !defined(__APPLE__)

TEST(parallel_limit_counter, basic) {
constexpr std::size_t global_max = 100000;
constexpr std::size_t thread_max = 10000;
Expand Down Expand Up @@ -50,8 +52,6 @@ TEST(parallel_limit_counter, basic) {
EXPECT_EQ(expected_sum, PARALLEL_LIMIT_COUNTER_READ(limit_counter));
}

#if !defined(__APPLE__)

TEST(parallel_limit_counter, accuracy) {
constexpr std::size_t global_max = 100000000;
constexpr std::size_t thread_max = 1000;
Expand Down
15 changes: 9 additions & 6 deletions tests/python/lib/stats_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,21 @@ def wait_next_stats(self, timeout=60):

def try_update_stats(self):
new_stats = {}
for stat_line in filter(None, self._stats_file_read_fd.readlines()):
lines = self._stats_file_read_fd.readlines()
for stat_line in filter(None, lines):
if stat_line[-1] != "\n":
raise RuntimeError("Got bad stat line: {}".format(stat_line))
stat, value = stat_line.split(":")
value, _ = value.split("|")
return False
try:
stat, value = stat_line.split(":")
value, _ = value.split("|")
except ValueError:
print("Got bad stat line: {}".format(stat_line))
return False
value = float(value.strip())
new_stats[stat.strip()] = value.is_integer() and int(value) or value

if not new_stats:
return False
if self._stats and len(self._stats) > len(new_stats):
raise RuntimeError("Got inconsistent stats count: old={} new={}".format(len(self._stats), len(new_stats)))
# HACK: replace prefix for kphp server stats
self._stats = {re.sub("^kphp_stats\\..+\\.", "kphp_server.", k): v for k, v in new_stats.items()}
return True
22 changes: 13 additions & 9 deletions tests/python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
portalocker
psutil
requests-toolbelt
pytest
pytest-mysql
pytest-postgresql
psycopg
pytest-xdist
zstandard
wheel==0.37.0
jsonschema==4.17.3
portalocker==2.7.0
psutil==5.9.5
requests==2.28.1
urllib3==1.26.12
requests-toolbelt==0.9.1
pytest==7.3.1
pytest-mysql==2.3.1
pytest-postgresql==4.1.1
psycopg==3.1.9
pytest-xdist==3.3.1
zstandard==0.21.0
7 changes: 0 additions & 7 deletions tests/python/tests/job_workers/test_job_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,6 @@ def test_job_exception_error(self):
"Error 0: Test exception"
])

def test_job_stack_overflow_error(self):
self.job_error_test_impl("stack_overflow", self.JOB_STACK_OVERFLOW_ERROR, data=[[1, 2, 3, 4, 5]], buffers=2)
self.kphp_server.assert_log([
"Critical error during script execution: sigsegv\\(stack overflow\\)",
"Error -1: Callstack overflow"
])

def test_job_php_assert_error(self):
self.job_error_test_impl("php_assert", self.JOB_PHP_ASSERT_ERROR)
self.kphp_server.assert_log(2 * [
Expand Down
3 changes: 2 additions & 1 deletion tests/tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ if(KPHP_TESTS)
endif()
target_link_options(${TEST_NAME} PRIVATE ${NO_PIE})

gtest_discover_tests(${TEST_NAME})
# because of https://github.com/VKCOM/kphp/actions/runs/5463884925/jobs/9945150190
gtest_discover_tests(${TEST_NAME} PROPERTIES DISCOVERY_TIMEOUT 600)
set_target_properties(${TEST_NAME} PROPERTIES FOLDER tests)
endfunction()

Expand Down