Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat third_party: up userver #38

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ jobs:

- name: Test run after install
if: matrix.make == 'test-release'
run: |
./local_installation/bin/pg_service_template --config=./local_installation/etc/pg_service_template/static_config.yaml &
run: >-
./local_installation/bin/pg_service_template
--config=./local_installation/etc/pg_service_template/static_config.yaml
--config_vars=./local_installation/etc/pg_service_template/config_vars.yaml
&

- name: Check work run service
if: matrix.make == 'test-release'
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ compile_commands.json
.cores/
cmake-build-*
Testing/
configs/static_config.yaml
configs/config_vars.yaml
configs/config_vars.docker.yaml
32 changes: 23 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,40 @@ add_google_tests(${PROJECT_NAME}_unittest)

# Benchmarks
add_executable(${PROJECT_NAME}_benchmark
src/hello_benchmark.cpp
src/hello_benchmark.cpp
)
target_link_libraries(${PROJECT_NAME}_benchmark PRIVATE ${PROJECT_NAME}_objs userver-ubench)
add_google_benchmark_tests(${PROJECT_NAME}_benchmark)


# Functional Tests
add_subdirectory(tests)
include(UserverTestsuite)

userver_testsuite_add_simple(
REQUIREMENTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/requirements.txt"
)


# Install
if(DEFINED ENV{PREFIX})
message(STATUS "Set install prefix: $ENV{PREFIX}")
file(TO_CMAKE_PATH "$ENV{PREFIX}" PREFIX_PATH)
set(CMAKE_INSTALL_PREFIX ${PREFIX_PATH})
message(STATUS "Set install prefix: $ENV{PREFIX}")
file(TO_CMAKE_PATH "$ENV{PREFIX}" PREFIX_PATH)
set(CMAKE_INSTALL_PREFIX ${PREFIX_PATH})
endif()

set(CONFIG_VAR_PATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_SYSCONFDIR}/${PROJECT_NAME}/config_vars.yaml)
set(CONFIG_FALLBACK_PATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_SYSCONFDIR}/${PROJECT_NAME}/dynamic_config_fallback.json)
set(CONFIG_FALLBACK_PATH
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_SYSCONFDIR}/${PROJECT_NAME}/dynamic_config_fallback.json")

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configs/static_config.yaml.in ${CMAKE_CURRENT_SOURCE_DIR}/configs/static_config.yaml)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/configs/config_vars.template.yaml"
"${CMAKE_CURRENT_SOURCE_DIR}/configs/config_vars.yaml"
)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/configs/config_vars.docker.template.yaml"
"${CMAKE_CURRENT_SOURCE_DIR}/configs/config_vars.docker.yaml"
)

FILE(GLOB CONFIGS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/configs/*.yaml ${CMAKE_CURRENT_SOURCE_DIR}/configs/*.json)
file(GLOB CONFIGS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/configs/*.yaml ${CMAKE_CURRENT_SOURCE_DIR}/configs/*.json)

install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${PROJECT_NAME})
install(FILES ${CONFIGS_FILES} DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/${PROJECT_NAME} COMPONENT ${PROJECT_NAME})
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ clean-debug clean-release: clean-%:
.PHONY: dist-clean
dist-clean:
@rm -rf build_*
@rm -f ./configs/static_config.yaml
@rm -f ./configs/config_vars.docker.yaml
@rm -f ./configs/config_vars.yaml
@rm -rf tests/__pycache__/
@rm -rf tests/.pytest_cache/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ worker-threads: 4
worker-fs-threads: 2
logger-level: debug

is_testing: false
is-testing: false

server-port: 8080

dbconnection: 'postgresql://user:password@service-postgres:5432/pg_service_template_db_1'

config-fallback-path: @CONFIG_FALLBACK_PATH@
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ worker-threads: 4
worker-fs-threads: 2
logger-level: debug

is_testing: false
is-testing: false

server-port: 8080

dbconnection: 'postgresql://pg_service_template_user:password@localhost:5432/pg_service_template_db_1'

config-fallback-path: @CONFIG_FALLBACK_PATH@
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ worker-threads: 4
worker-fs-threads: 2
logger-level: debug

is_testing: true

server-port: 8080
is-testing: true

# pg_service_template_db_1 is the service name + _ + filename of the db_1.sql
dbconnection: 'postgresql://testsuite@localhost:15433/pg_service_template_db_1'
8 changes: 3 additions & 5 deletions configs/static_config.yaml.in → configs/static_config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# yaml

config_vars: @CONFIG_VAR_PATH@

components_manager:
coro_pool:
initial_size: 500 # Preallocate 500 coroutines at startup.
Expand Down Expand Up @@ -38,15 +36,15 @@ components_manager:
dynamic-config: # Dynamic config storage options, do nothing
fs-cache-path: ''
dynamic-config-fallbacks: # Load options from file and push them into the dynamic config storage.
fallback-path: @CONFIG_FALLBACK_PATH@
fallback-path: $config-fallback-path
testsuite-support: {}

http-client:
load-enabled: $is_testing
load-enabled: $is-testing
fs-task-processor: fs-task-processor

tests-control:
load-enabled: $is_testing
load-enabled: $is-testing
path: /tests/{action}
method: POST
task_processor: main-task-processor
Expand Down
19 changes: 0 additions & 19 deletions tests/CMakeLists.txt

This file was deleted.

2 changes: 1 addition & 1 deletion third_party/userver
Submodule userver updated 89 files
+1 −1 .github/workflows/ci-conan.yml
+4 −4 .github/workflows/ci.yml
+6 −1 .mapping.json
+20 −19 CMakeLists.txt
+12 −12 clickhouse/CMakeLists.txt
+0 −14 clickhouse/functional_tests/CMakeLists.txt
+3 −5 clickhouse/functional_tests/basic_chaos/CMakeLists.txt
+3 −5 clickhouse/functional_tests/metrics/CMakeLists.txt
+2 −14 cmake/FindPython.cmake
+23 −25 cmake/GrpcTargets.cmake
+15 −0 cmake/SetupCryptoPP.cmake
+320 −47 cmake/UserverTestsuite.cmake
+5 −13 conanfile.py
+9 −9 core/CMakeLists.txt
+0 −21 core/functional_tests/CMakeLists.txt
+2 −1 core/functional_tests/basic_chaos/CMakeLists.txt
+17 −0 core/functional_tests/basic_chaos/tests-deadline/conftest.py
+251 −0 core/functional_tests/basic_chaos/tests-deadline/test_client.py
+88 −0 core/functional_tests/basic_chaos/tests-deadline/test_server.py
+0 −228 core/functional_tests/basic_chaos/tests/httpclient/test_httpclient.py
+0 −43 core/functional_tests/basic_chaos/tests/httpserver/test_httpserver.py
+1 −1 core/functional_tests/websocket/tests/test_websocket.py
+2 −0 core/include/userver/clients/http/plugin.hpp
+68 −0 core/include/userver/clients/http/response.hpp
+1 −0 core/include/userver/tracing/span_builder.hpp
+6 −2 core/src/clients/http/request_state.cpp
+116 −0 core/src/clients/http/response.cpp
+13 −22 core/src/components/run.cpp
+3 −0 core/src/testsuite/impl/actions/control.cpp
+6 −0 core/src/tracing/span_builder.cpp
+0 −30 external-deps/PostgreSQL.yaml
+0 −34 grpc/functional_tests/CMakeLists.txt
+2 −2 grpc/functional_tests/basic_chaos/CMakeLists.txt
+2 −2 grpc/functional_tests/metrics/CMakeLists.txt
+7 −7 grpc/handlers/CMakeLists.txt
+0 −22 grpc/handlers/functional_tests/CMakeLists.txt
+3 −1 grpc/handlers/functional_tests/health/CMakeLists.txt
+1 −1 grpc/include/userver/ugrpc/server/server.hpp
+5 −2 grpc/src/ugrpc/server/rpc.cpp
+91 −0 grpc/tests/src/logging_test.cpp
+3 −2 grpc/utest/include/userver/ugrpc/tests/service.hpp
+3 −8 grpc/utest/src/ugrpc/tests/service.cpp
+16 −16 mongo/CMakeLists.txt
+0 −23 mongo/functional_tests/CMakeLists.txt
+3 −3 mysql/CMakeLists.txt
+0 −14 mysql/functional_tests/CMakeLists.txt
+3 −5 mysql/functional_tests/basic_chaos/CMakeLists.txt
+16 −20 postgresql/CMakeLists.txt
+0 −23 postgresql/functional_tests/CMakeLists.txt
+0 −3 postgresql/pq-extra/CMakeLists.txt
+1 −1 rabbitmq/CMakeLists.txt
+0 −27 rabbitmq/functional_tests/CMakeLists.txt
+3 −5 rabbitmq/functional_tests/basic_chaos/CMakeLists.txt
+3 −1 rabbitmq/functional_tests/metrics/CMakeLists.txt
+18 −18 redis/CMakeLists.txt
+0 −14 redis/functional_tests/CMakeLists.txt
+2 −37 samples/CMakeLists.txt
+3 −5 samples/clickhouse_service/CMakeLists.txt
+2 −2 samples/grpc_service/CMakeLists.txt
+2 −9 samples/mongo-support/CMakeLists.txt
+2 −11 samples/postgres-support/CMakeLists.txt
+3 −5 samples/rabbitmq_service/CMakeLists.txt
+1 −11 samples/tcp_full_duplex_service/CMakeLists.txt
+1 −11 samples/tcp_service/CMakeLists.txt
+14 −0 samples/testsuite-support/tests/test_mocked_time.py
+157 −0 scripts/docs/Stiker-11.svg
+1,724 −0 scripts/docs/Stiker-12.svg
+18 −2 scripts/docs/en/userver/functional_testing.md
+0 −1 scripts/external_deps/requirements.txt
+1 −5 scripts/grpc/protoc_usrv_plugin.sh
+2 −1 scripts/grpc/requirements-old.txt
+2 −1 scripts/grpc/requirements.txt
+15 −0 testsuite/SetupUserverTestsuiteEnv.cmake
+6 −4 third_party/uboost_coro/README.md
+55 −0 third_party/uboost_coro/include/uboost_coro/context/continuation_fcontext.hpp
+33 −9 third_party/uboost_coro/include/uboost_coro/context/continuation_ucontext.hpp
+55 −8 third_party/uboost_coro/include/uboost_coro/context/fiber_fcontext.hpp
+33 −17 third_party/uboost_coro/include/uboost_coro/context/fiber_ucontext.hpp
+0 −8 third_party/uboost_coro/include/uboost_coro/context/fiber_winfib.hpp
+1 −0 third_party/uboost_coro/include/uboost_coro/context/windows/protected_fixedsize_stack.hpp
+27 −17 third_party/uboost_coro/src/context/asm/jump_i386_sysv_elf_gas.S
+63 −17 third_party/uboost_coro/src/context/asm/jump_x86_64_sysv_elf_gas.S
+16 −10 third_party/uboost_coro/src/context/asm/make_i386_sysv_elf_gas.S
+64 −6 third_party/uboost_coro/src/context/asm/make_x86_64_sysv_elf_gas.S
+29 −19 third_party/uboost_coro/src/context/asm/ontop_i386_sysv_elf_gas.S
+55 −16 third_party/uboost_coro/src/context/asm/ontop_x86_64_sysv_elf_gas.S
+11 −11 universal/CMakeLists.txt
+2 −0 universal/include/userver/http/predefined_header.hpp
+1 −0 universal/include/userver/utils/from_string.hpp
Loading