summaryrefslogtreecommitdiffhomepage
path: root/test/unit/applications (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-07-07Update third-party components for Unit's Java module.Sergey A. Osokin1-1/+1
2023-06-14Tests: get rid of classes in test files.Andrei Zeliankou10-35/+43
Class usage came from the unittest framework and it was always redundant after migration to the pytest. This commit removes classes from files containing tests to make them more readable and understandable.
2023-06-12Tests: prerequisites checking reworked.Andrei Zeliankou1-3/+0
Prerequisites check moved to the module level to simplify class structure. Discovery and prerequisites checks functions moved to the separate files. Introduced "require" fixture to provide per-test requirements check.
2023-05-29Tests: more fixtures.Andrei Zeliankou1-24/+0
Common methods from applications/proto.py converted to the fixtures. sysctl check moved to the specific file where it is using. Some options moved to the constructor to have early access.
2023-05-29Tests: Log reworked.Andrei Zeliankou1-4/+2
All log-related code moved to the log.py.
2023-05-25Tests: removed unused variables.Andrei Zeliankou1-1/+1
2023-03-27Tests: relaxed jar glob.Konstantin Pavlov1-1/+1
We install jars with names like websocket-api-${NXT_JAVA_MODULE}-$NXT_VERSION.jar, which translates to versioned NXT_JAVA_MODULE in the packaging system, e.g. websocket-api-java11-1.30.0.jar.
2023-02-21Tests: switched to using f-strings.Andrei Zeliankou9-96/+86
Previously, it was necessary to support older versions of Python for compatibility. F-strings were released in Python 3.6. Python 3.5 was marked as unsupported by the end of 2020, so now it's possible to start using f-strings safely for better readability and performance.
2023-02-21Tests: removed list usage as default argument.Andrei Zeliankou1-1/+3
Mutable types as default arguments is bad practice since they are evaluated only once when the function is defined.
2022-12-14Python: Added "prefix" to configuration.OutOfFocus41-0/+1
This patch gives users the option to set a `"prefix"` attribute for Python applications, either at the top level or for specific `"target"`s. If the attribute is present, the value of `"prefix"` must be a string beginning with `"/"`. If the value of the `"prefix"` attribute is longer than 1 character and ends in `"/"`, the trailing `"/"` is stripped. The purpose of the `"prefix"` attribute is to set the `SCRIPT_NAME` context value for WSGI applications and the `root_path` context value for ASGI applications, allowing applications to properly route requests regardless of the path that the server uses to expose the application. The context value is only set if the request's URL path begins with the value of the `"prefix"` attribute. In all other cases, the `SCRIPT_NAME` or `root_path` values are not set. In addition, for WSGI applications, the value of `"prefix"` will be stripped from the beginning of the request's URL path before it is sent to the application. Reviewed-by: Andrei Zeliankou <zelenkov@nginx.com> Reviewed-by: Artem Konev <artem.konev@nginx.com> Signed-off-by: Alejandro Colomar <alx@nginx.com>
2022-12-14Java: upgrading third-party components.Sergey A. Osokin1-1/+1
2022-12-12Tests: pretty output.Andrei Zeliankou1-2/+4
Hide expected alerts by default. Silence succesfull "go build" information.
2022-10-11Tests: don't try to return response when "no_recv" is True.Andrei Zeliankou1-2/+1
2022-07-28Tests: added flags to search functions in proto.py.Andrei Zeliankou1-6/+6
Also removed unnesessary re.compile() calls.
2022-06-30Tests: minor improvements.Andrei Zeliankou2-1/+6
Added "go" availability check before trying to build an application. update_action() method used were possible and fixed bug with the relative path determination in test_static_chroot.py. Templates optimization and style fixes.
2022-04-11Tests: style.Andrei Zeliankou2-7/+10
2022-01-31Tests: removed TestApplicationTLS.get_server_certificate().Andrei Zeliankou1-15/+0
distutils.version is replaced by packaging.version. Also minor style fixes.
2022-01-10Tests: using modules in Go.Max Romanov1-11/+32
2021-11-15Tests: refactored working with processes.Andrei Zeliankou3-11/+16
2021-11-09Tests: PHP shared opcache test added.Max Romanov1-9/+18
2021-11-02Tests: removed unused imports.Andrei Zeliankou1-1/+0
2021-10-18Tests: style.Andrei Zeliankou2-2/+1
2021-08-12Java: upgrading third-party components.Max Romanov1-1/+1
2021-08-09Java: upgrading third-party components.Max Romanov1-1/+1
2021-07-29Application restart introduced.Max Romanov1-0/+1
When processing a restart request, the router sends a QUIT message to all existing processes of the application. Then, a new shared application port is created to ensure that new requests won't be handled by the old processes of the application.
2021-07-02Tests: Ruby hooks.Oisin Canty2-16/+24
2021-07-02Tests: run Ruby applications inside temporary directory.Oisin Canty1-1/+15
2021-05-25Go: fixing tests for Go 1.16.Max Romanov1-0/+1
In Go 1.16, the module-aware mode is enabled by default; to fall back to previous behavior, the GO111MODULE environment variable should be set to 'auto'. Details: https://golang.org/doc/go1.16
2021-05-24Node.js: renamed "require_shim" to "loader".Oisin Canty1-3/+3
2021-05-20Tests: Python targets.Oisin Canty1-2/+9
2021-05-12Tests: added test for TLS with IP in SAN.Andrei Zeliankou1-2/+7
2021-05-12Node.js: a shim for overriding "http" and "websocket" modules.Oisin Canty1-3/+18
Also added stubs for Server.address() This was done to prevent crashes in some popular frameworks like express Supports both CommonJS and the new ES Modules system syntax e.g: app.js: const http = require('http') app.mjs: import http from "http" Usage on Node 14.16.x and higher: { "type": "external", "processes": {"spare": 0}, "working_directory": '/project', "executable": "/usr/bin/env", "arguments": [ "node", "--loader", "unit-http/require_shim.mjs" "--require", "unit-http/require_shim", "app.js" ] } Usage on Node 14.15.x and lower: { "type": "external", "processes": {"spare": 0}, "working_directory": '/project', "executable": "/usr/bin/env", "arguments": [ "node", "--require", "unit-http/require_shim", "app.js" ] }
2021-04-08Tests: preserving unit.log when run without restart.Max Romanov1-6/+12
Introducing "unit.log.Log" class for "unit.log" file management. Moving "findall()" function into TestApplicationProto. Using "os.kill()" to send signals.
2021-04-05Tests: style.Andrei Zeliankou2-18/+22
2021-03-26Tests: SNI.Andrei Zeliankou1-3/+18
2021-03-22Java: upgrading third-party components.Sergey A. Osokin1-1/+1
2021-02-10Tests: increased timeout in wait_for_record().Andrei Zeliankou1-2/+2
2020-12-21Tests: introduced a separate cache directory for Go builds.Tiago Natel de Moura1-0/+1
The Go compiler can't detect changes to C header files when compiling CGO applications, and then this leads to Go test samples being linked with wrong libunit. This patch creates a new cache directory reused throughout the test suite.
2020-12-08Tests: utils module introduced.Andrei Zeliankou1-1/+1
2020-12-06Tests: options moved to the separate class.Andrei Zeliankou9-9/+9
This change is necessary to separate the logic and prevent possible circular dependency.
2020-11-16Tests: fixing tests interrupt in terminal.Max Romanov2-1/+13
KeyboardInterrupt re-raised.
2020-11-10Python: supporting ASGI legacy protocol.Max Romanov1-1/+2
Introducing manual protocol selection for 'universal' apps and frameworks.
2020-11-10Tests: supporting instant app parameters in load().Max Romanov1-9/+13
2020-11-03Tests: force applications to build for JVM 8.Andrei Zeliankou1-0/+1
This change is made to avoid situations when an application is compiled for a version newer than the Java module used.
2020-11-02Java: upgrading 3rd-party components.Max Romanov1-1/+1
2020-10-29Isolation: mounting of procfs by default when using "rootfs".Tiago Natel de Moura1-0/+14
2020-10-28Tests: improving get_application_type() and fixing its name.Max Romanov6-27/+11
This patch also enables multiversion tests running for Java.
2020-10-27Tests: fixed isolation detection.Andrei Zeliankou2-4/+13
2020-10-19Tests: fixed unit.log print.Andrei Zeliankou6-20/+17
2020-10-07Tests: minor fixes.Andrei Zeliankou10-16/+14