-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Qual: Improve hurl script, add to pre-commit, add to win-ci #36279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
149096e to
53d2ece
Compare
|
@JonBendtsen I've added hurl to the windows flow. It's only executed on forks and manual workflow triggers at this time. See https://github.com/mdeweerd/dolibarr/actions/runs/19409056135 for some results. I updated logToCs to extract the hurl errors. |
Great idea, though right now something has changed such that the hurl tests that used to work no longer works :-( Eventually I wish that hurl (or something similar) would be part of the build process so we would detect possible issues earlier I even see it as useful for Dolibarr administrators because if they run a hurl test to check their setup and detect changes between upgrades and/or configuration changes then they can better tell their users of the changes with a new version. JonB JonB |
c86fb8f to
92e1deb
Compare
|
When tests are not in ci, they end up no longer working. Now run.sh can run just a few tests and I added a pre-commit hook configuration that runs only changed hurl files ( ONe reason for failure in my case seem to be that debug information is added - so hurl would need to ignore debug information somehow: |
92e1deb to
088b680
Compare
yeah, I totally agree, I was just not yet ready to do it my self, and I also did not expect that it would break so fast. I hoped - and this might be what happened ;-) - that someone with more Dolibarr/development/PHP experience than me would take the initiative and put it into the CI :-D Some of the things hold me back was that I do not know if the build system starts a Dolibarr, what data it contains, which modules are enabled, ... so I feared ending up enabling something which would always fail - and that is not useful either.
Looks great :-)
OR ASSERT that there would be debug information ;-)
|
What if there are no changed hurl files, only changes in non hurl files? should hurl ideally be run at each and every commit? just like all the other checks? |
I just refactored this part of the documentation.
Enabling & disabling a module is something to think about - or maybe already ok. However, no example so far I think.
When the tests are short, they can run on every commit. If not, the script could be smarter in the future and examine which files are commited, what test they belong to and run these.
I think this is one of the things that the tests must be hardened for - debug information is not always present, so it should ignore this. |
yeah, that was my thought, such that POSTS to put in data which was then GET, PUT and finally DELETE. For this order matters and numbers are one way of getting that.
yeah, and we could possible have many smaller files, and some kind of system to detect which function in which file was changed, because there is no need to test unchanged functions. I see some methods for doing this:
Like
Given that the error message is json, right even with the debug information, then I think that rather than folding this down to one line then you could possibly use something like Let's try that. |
I think this commit can handle both if there is a "debug" key in the json and if there is not |
|
I'll let you evolve the tests - you can test the updated script. I've added the exclusion option, and also a help option. |
If I am the only one creating/writing/fixing/updating/... tests then it will take a while before everything is covered. Preferably I would want the Dolibarr community to get to the point that if a PR that adds new functionality doesn't come with a working hurl test, then it wouldn't get merged - Possibly we need to have someone help writing the tests, but they are not that hard, and often one can find an example to copy. I do not think that my Dolibarr gives the debug output that you got in the output you included above. |
Open-source is generally though there. I decided to help with improving the flow, but not so much with the functionnality. I fixed >20k phan notices, implemented a fast script to check for missing translations keys, setup the win-ci flow, ... . And I have some other opensource projects to attend to.
I am sure there will be some momentum at some point. More examples and even some slide for eldy to present can be helpful.
It's also in https://github.com/mdeweerd/dolibarr/actions/runs/19411735332/job/55534085760 and the database is built from scratch using |
yeah I can imagine it could be tough, volunteers and such. Dolibarr is so far the only project I contribute to.
yeah maybe I should write such a slide - or possibly show up and being able to answer questions and tell about my experience - I just don't speak french, but I do plan to talk and share at the International DevCamp. In the https://github.com/Dolibarr/dolibarr/blob/develop/test/hurl/README.md file I did write that we (Dolibarr community) should discuss here in 2025, but I haven't seen any, and I also did not write where we should have that discussion. Do you know of any place where such a discussion has happened?
okay. So far I just used hurl tests with my own development Dolibarr with a database restored from my production Dolibarr. |
I think that your GUI tests fails because it is not logged in. |
747f309 to
4a625b1
Compare
I think this is better: |
|
FYI, some resources |
I was in Vienna it's hard when the presentations are in French |
My Browser counts 31 times with the string: |
|
API test that uses API key created from login/password is working - so I suppose API key is ok: Then we have: And failing tests next - so it seems to be an issue with the cookie file. |
c73632a to
558ded5
Compare
3d5b504 to
499b898
Compare
|
I found a reason: the windows version of hurl needs a windows like path. "Show logo on menu" is not in the output (not even in a regular browser when logged in), tests still fail, but at least now the cookie is ok. However, it is clear that the login cookie is not ok. https://github.com/mdeweerd/dolibarr/actions |
|
Locally I get a correct cookie. Quite strange that the behavior is different in ci - the credentials are ok because I can get an API token with it and locally I used the same procedure for the database contents (sql available in the WIN CI artifact by the way). php -S 127.0.0.1:8000 -t htdocs # php.ini
[php]
open_basedir="D:\workspace\documents;D:\workspace\htdocs" |
maybe you can try with this test method #36294 which uses a different text string |
062d819 to
2242248
Compare
I'll check when it's integrated. For the moment the issue seems elsewhere: CSRF. Not sure that this should be invalidating the cookie, so From dolibarr.log (available in the win-ci run artifacts): Not so good IMHO but not blocking I suppose. |
2242248 to
0d60ec9
Compare
- Add HURL test runner to Windows CI workflow - Include environment variables for test configuration - Update test execution step to run HURL tests when enabled
- Added --verbose and --very-verbose options to control hurl output verbosity - Updated help message to include new options - Modified test execution to use the VERBOSE variable - Added shellcheck disable for SC2086 to handle the VERBOSE variable correctly
0d60ec9 to
4564c14
Compare
Qual: Improve hurl script, add to pre-commit, add to win-ci