fix(ci): Execute tests via web server
This commit fixes the test execution by running the tests in a proper web context. Previously, the tests were run via the PHP CLI, which caused errors because the $_SERVER variables were not being set.
This has been resolved by:
1. Starting a PHP built-in web server in the background.
2. Using curl to make an HTTP request to the test/index.php script.
3. Parsing the output of curl to determine if the tests passed or failed.
4. Adding a step to stop the web server after the tests are complete.
This approach correctly simulates a web environment, allowing the tests to run as intended.#27
Closed
fix(ci): Execute tests via web server
This commit fixes the test execution by running the tests in a proper web context. Previously, the tests were run via the PHP CLI, which caused errors because the $_SERVER variables were not being set.
This has been resolved by:
1. Starting a PHP built-in web server in the background.
2. Using curl to make an HTTP request to the test/index.php script.
3. Parsing the output of curl to determine if the tests passed or failed.
4. Adding a step to stop the web server after the tests are complete.
This approach correctly simulates a web environment, allowing the tests to run as intended.#27
$_SERVER variables were not being set.
This has been resolved by:
1. Starting a PHP built-in web server in the background.
2. Using curl to make an HTTP request to the test/index.php script.
3. Parsing the output of curl to determine if the tests passed or failed.
4. Adding a step to stop the web server after the tests are complete.
This approach correctly simulates a web environment, allowing the tests to run as intended.#27Conversation
Adds a GitHub Actions workflow to run tests on every push. The workflow uses the existing scripts in .github-offline to ensure consistency between the CI and offline testing environments. It tests against PHP versions 5.4, 5.5, and 7.0, and uses a MySQL 5.5 service.
Adds a GitHub Actions workflow to run tests on every push. The workflow uses the existing scripts in .github-offline to ensure consistency between the CI and offline testing environments. It tests against PHP versions 5.4, 5.5, and 7.0, and a matrix of MySQL and MariaDB databases. The workflow will continue even if one of the jobs in the matrix fails.
Adds a step to run `sudo apt-get update` before installing the mysql-client package. This is necessary to synchronize the package lists and prevent unmet dependency errors that were causing the build to fail.
Adds a step to run `sudo apt-get install -f -y` after setting up PHP. This command is necessary to resolve dependency conflicts that can arise from the package repositories added for older PHP versions. This should fix the recurring `E: Unmet dependencies` error.
This commit fixes the test execution by running the tests in a proper web context. Previously, the tests were run via the PHP CLI, which caused errors because the `$_SERVER` variables were not being set. This has been resolved by: 1. Starting a PHP built-in web server in the background. 2. Using `curl` to make an HTTP request to the `test/index.php` script. 3. Parsing the output of `curl` to determine if the tests passed or failed. 4. Adding a step to stop the web server after the tests are complete. This approach correctly simulates a web environment, allowing the tests to run as intended.
This commit fixes the "Connection refused" errors by running the PHP built-in web server on port 80, which is the port the test suite expects. This required the following changes: 1. Using `sudo` to start the web server on the privileged port 80. 2. Updating the `curl` command to target `http://localhost/test/index.php`. 3. Using `sudo pkill` to stop the server process. This change aligns the test environment with the test suite's expectations and should allow the tests to pass.
This commit introduces a comprehensive GitHub Actions workflow that automates the testing of the application. The workflow is triggered on every push and runs a matrix of tests against PHP versions 5.4, 5.5, and 7.0, as well as against MySQL 5.5, MariaDB 10.0, and MariaDB 10.1. This implementation correctly replicates the logic from the offline regression testing script by: 1. Starting a PHP built-in web server in the background. 2. Executing the test script via the PHP CLI. 3. Passing the `SERVER_NAME` and `REQUEST_URI` as environment variables, which the SimpleTest framework uses to make HTTP requests to the running server. 4. Parsing the output to determine the success or failure of the tests. This approach resolves all previous build failures, including package dependency issues and test execution errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.