mirror of
https://github.com/cypht-org/cypht.git
synced 2026-04-25 04:56:03 +03:00
[GH-ISSUE #1011] Running local tests #540
Labels
No labels
2fa
I18N
PGP
Security
Security
account
advanced_search
advanced_search
announcement
api_login
authentication
awaiting feedback
blocker
bug
bug
bug
calendar
config
contacts
core
core
devops
docker
docs
duplicate
dynamic_login
enhancement
epic
feature
feeds
framework
github
github
gmail_contacts
good first issue
help wanted
history
history
imap
imap_folders
inline_message
installation
keyboard_shortcuts
keyboard_shortcuts
ldap_contacts
mobile
need-ssh-access
new module set
nux
pop3
profiles
pull-request
question
refactor
release
research
saved_searches
smtp
strategic
tags
tests
themes
website
wordpress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cypht#540
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jonocodes on GitHub (May 7, 2024).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/1011
Originally assigned to: @IrAlfred on GitHub.
💬 Question
What is the test methodology in cypht? Asking because I am trying to run at least the unit tests locally and getting failures.
I see tests being run in the .travis dir, but I would think devs would want to run tests locally while they are working, not just in CI. Perhaps adding some development notes to the read me with instructions on how to run tests would be helpful.
@marclaporte commented on GitHub (May 9, 2024):
@josaphatim please advise
@josaphatim commented on GitHub (May 9, 2024):
@jonocodes
please just make sure you have a database, database user and password with the value cypht_test
If not you can change setup_db function in tests/phpunit/mocks.php and also change Hm_Test_DB::test_build_dsn in tests/phpunit/db.php to your own values. You can add the port to db_host if not using 3306 for mysql
I personally run tests with
php vendor/phpunit/phpunit/phpunit --configuration tests/phpunit/phpunit.xmlfrom the root folder@jonocodes commented on GitHub (May 17, 2024):
Thanks @josaphatim. By editing a few files and manually running some scripts I was able to get the tests to pass.
My suggestion is to make this frictionless, which would be fairly simple from what is there. The idea is I should be able to check out the code from git, and run a single command that will run the tests right away to see that they pass. This is very valuable for developers and new users. If we default to using sqlite instead of mysql this is very easy since no services need to be installed/started. So lets start by focusing on sqlite only, unit tests only.
Here is what I suggest.
I can probably work on this if it sounds good.
@marclaporte commented on GitHub (May 18, 2024):
@kroky thoughts?
@kroky commented on GitHub (May 20, 2024):
.github is specific to the CI, let's keep it there and not move it to tests.
+1 for the rest - devs should just be able to run phpunit and even selenium to execute their tests locally. If any specific setup is required and can't be done automatically, we should include documentation in a readme how to run the tests.
@jonocodes commented on GitHub (May 22, 2024):
Ok, for now I wont move anything out of .github. I will start by copying it out an modifying it. Here is the basic idea:
https://github.com/cypht-org/cypht/pull/1042
@IrAlfred commented on GitHub (Sep 26, 2025):
Related issue: https://github.com/cypht-org/cypht/issues/1710
@IrAlfred commented on GitHub (Nov 20, 2025):
https://github.com/cypht-org/cypht/wiki/Running-local-Tests-in-Cypht
@marclaporte commented on GitHub (Nov 22, 2025):
@jonocodes I look forward to your feedback :-)
@jonocodes commented on GitHub (Nov 24, 2025):
Yes, this is very much what I had in mind. And great writeup @IrAlfred .