Skip to content

ci: add a basic smoke test check#174

Merged
JohnVillalovos merged 1 commit intomasterfrom
jlvillal/smoke
Mar 10, 2026
Merged

ci: add a basic smoke test check#174
JohnVillalovos merged 1 commit intomasterfrom
jlvillal/smoke

Conversation

@JohnVillalovos
Copy link
Collaborator

This runs the docker image and attempts to connect to it.

Copilot AI review requested due to automatic review settings March 9, 2026 05:41
@JohnVillalovos JohnVillalovos marked this pull request as draft March 9, 2026 05:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a basic smoke test to the pull request CI workflow. After successfully building the Docker image, the new steps start the container, poll the HTTP endpoint until it's ready (up to 60 seconds), verify that four required PHP extensions are loaded, and clean up the container regardless of outcome. This complements the existing lint and build checks to give earlier signal that the produced image is functional.

Changes:

  • The build step now loads the image locally (changed from load: false to load: true) and assigns a tag so it can be referenced by later steps.
  • A "Smoke test image" step runs the container, polls the HTTP endpoint with retries, and checks that gd, ldap, mysqli, and timezonedb PHP modules are present.
  • "Dump smoke logs on failure" and "Cleanup smoke container" housekeeping steps are added.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@JohnVillalovos JohnVillalovos force-pushed the jlvillal/smoke branch 6 times, most recently from 49ed359 to edb6afd Compare March 9, 2026 06:18
@JohnVillalovos JohnVillalovos marked this pull request as ready for review March 9, 2026 06:21
@JohnVillalovos JohnVillalovos requested a review from Copilot March 9, 2026 06:34
@JohnVillalovos JohnVillalovos marked this pull request as draft March 9, 2026 06:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

docker cp librebooking-smoke-src:/var/www/html/database_schema /tmp/librebooking-database_schema
docker rm librebooking-smoke-src

cat \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given what you are testing, I am not sure you needto create the database

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without a database Librebooking will give an error message when trying to access it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is odd.
When I run librebooking without any sql container, I don't have any issue.

robin@trixie-dev:~$ docker container ls
CONTAINER ID   IMAGE                COMMAND                  CREATED              STATUS              PORTS                                         NAMES
7179644bd62f   librebooking:4.2.0   "/usr/local/bin/entr…"   About a minute ago   Up About a minute   0.0.0.0:8080->8080/tcp, [::]:8080->8080/tcp   librebooking-app-1
robin@trixie-dev:~$ curl --silent --show-error --fail --max-time 2 http://localhost:8080
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://localhost:8080/Web/">here</a>.</p>
<hr>
<address>Apache/2.4.66 (Debian) Server at localhost Port 8080</address>
</body></html>

Please note that the URL is http://localhost:8080 when I run from my laptop

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But when you go to http://localhost:8080/Web/ it will give a 500 😢 if no SQL.

All that is testing is .htaccess is working.

/tmp/librebooking-database_schema/create-schema.sql \
| docker exec --interactive "${mysql_service_id}" mysql --user root --password=root

docker run --rm \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same remark as above

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without a database Librebooking will give an error message when trying to access it.

"${image_tag}"

for attempt in $(seq 1 30); do
if curl --silent --show-error --fail --max-time 2 http://127.0.0.1:18080/Web/; then
Copy link
Collaborator

@colisee colisee Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would curl the /web/install URL path, instead.

In a future release, I would investigate the utilization of web page test automation tools, such as Playwright.

Please note that upstream could benefit from such tools.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is /Web/install better?

Playwright looks interesting. I would like a LOT more actual testing of the app in the upstream project.

@JohnVillalovos JohnVillalovos marked this pull request as ready for review March 10, 2026 15:16
This runs the docker image and attempts to connect to it.
@JohnVillalovos JohnVillalovos merged commit 6210d1d into master Mar 10, 2026
2 checks passed
@JohnVillalovos JohnVillalovos deleted the jlvillal/smoke branch March 10, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants