mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-12-11 19:57:23 +03:00
DB Testing: Updated supported DB list, added readme
Also fixed potentally flaky GIf test to be more accurate with single frame GIF images.
This commit is contained in:
@@ -19,8 +19,8 @@ ARG BRANCH=development
|
|||||||
# Download BookStack & install PHP deps
|
# Download BookStack & install PHP deps
|
||||||
RUN mkdir -p /var/www && \
|
RUN mkdir -p /var/www && \
|
||||||
git clone https://github.com/bookstackapp/bookstack.git --branch "$BRANCH" --single-branch /var/www/bookstack && \
|
git clone https://github.com/bookstackapp/bookstack.git --branch "$BRANCH" --single-branch /var/www/bookstack && \
|
||||||
cd /var/www/bookstack && \
|
cd /var/www/bookstack && \
|
||||||
wget https://raw.githubusercontent.com/composer/getcomposer.org/f3108f64b4e1c1ce6eb462b159956461592b3e3e/web/installer -O - -q | php -- --quiet --filename=composer && \
|
wget https://raw.githubusercontent.com/composer/getcomposer.org/f3108f64b4e1c1ce6eb462b159956461592b3e3e/web/installer -O - -q | php -- --quiet --filename=composer && \
|
||||||
php composer install
|
php composer install
|
||||||
|
|
||||||
# Set the BookStack dir as the default working dir
|
# Set the BookStack dir as the default working dir
|
||||||
|
|||||||
32
dev/docker/db-testing/readme.md
Normal file
32
dev/docker/db-testing/readme.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# Database Testing Suite
|
||||||
|
|
||||||
|
This docker setup is designed to run BookStack's test suite against each major database version we support
|
||||||
|
across MySQL and MariaDB to ensure compatibility and highlight any potential issues before a release.
|
||||||
|
This is a fairly slow and heavy process, so is designed to just be run manually before a release which
|
||||||
|
makes changes to the database schema, or a release which makes significant changes to database queries.
|
||||||
|
|
||||||
|
### Running
|
||||||
|
|
||||||
|
Everything is ran via the `run.sh` script. This will:
|
||||||
|
|
||||||
|
- Optionally, accept a branch of BookStack to use for testing.
|
||||||
|
- Build the docker image from the `Dockerfile`.
|
||||||
|
- This will include a built-in copy of the chosen BookStack branch.
|
||||||
|
- Cycle through each major supported database version:
|
||||||
|
- Migrate and seed the database.
|
||||||
|
- Run the full PHP test suite.
|
||||||
|
|
||||||
|
If there's a failure for a database version, the script will prompt if you'd like to continue or stop testing.
|
||||||
|
|
||||||
|
This script should be ran from this `db-testing` directory:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Enter this directory
|
||||||
|
cd dev/docker/db-testing
|
||||||
|
|
||||||
|
# Runs for the 'development' branch by default
|
||||||
|
./run.sh
|
||||||
|
|
||||||
|
# Run for a specific branch
|
||||||
|
./run.sh v25-11
|
||||||
|
```
|
||||||
@@ -11,11 +11,9 @@ fi
|
|||||||
|
|
||||||
# List of database containers to test against
|
# List of database containers to test against
|
||||||
containers=(
|
containers=(
|
||||||
"mysql:5.7"
|
|
||||||
"mysql:8.0"
|
"mysql:8.0"
|
||||||
"mysql:8.4"
|
"mysql:8.4"
|
||||||
"mysql:9.5"
|
"mysql:9.5"
|
||||||
"mariadb:10.2"
|
|
||||||
"mariadb:10.6"
|
"mariadb:10.6"
|
||||||
"mariadb:10.11"
|
"mariadb:10.11"
|
||||||
"mariadb:11.4"
|
"mariadb:11.4"
|
||||||
|
|||||||
@@ -720,15 +720,15 @@ class ImageTest extends TestCase
|
|||||||
$galleryFileSize = filesize($galleryThumbPath);
|
$galleryFileSize = filesize($galleryThumbPath);
|
||||||
|
|
||||||
// Basic scan of GIF content to check frame count
|
// Basic scan of GIF content to check frame count
|
||||||
$originalFrameCount = count(explode("\x00\x21\xF9", file_get_contents($originalFile)));
|
$originalFrameCount = count(explode("\x00\x21\xF9", file_get_contents($originalFile))) - 1;
|
||||||
$galleryFrameCount = count(explode("\x00\x21\xF9", file_get_contents($galleryThumbPath)));
|
$galleryFrameCount = count(explode("\x00\x21\xF9", file_get_contents($galleryThumbPath))) - 1;
|
||||||
|
|
||||||
$this->files->deleteAtRelativePath($relPath);
|
$this->files->deleteAtRelativePath($relPath);
|
||||||
$this->files->deleteAtRelativePath($galleryThumbRelPath);
|
$this->files->deleteAtRelativePath($galleryThumbRelPath);
|
||||||
|
|
||||||
$this->assertNotEquals($originalFileSize, $galleryFileSize);
|
$this->assertNotEquals($originalFileSize, $galleryFileSize);
|
||||||
$this->assertEquals(3, $originalFrameCount);
|
$this->assertEquals(2, $originalFrameCount);
|
||||||
$this->assertEquals(1, $galleryFrameCount);
|
$this->assertLessThan(2, $galleryFrameCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getTestProfileImage()
|
protected function getTestProfileImage()
|
||||||
|
|||||||
Reference in New Issue
Block a user