atuttle / Taffy

:candy: The REST Web Service framework for ColdFusion and Lucee
http://taffy.io
Other
226 stars 117 forks source link

Move testing over to GitHub Actions #415

Open atuttle opened 3 years ago

atuttle commented 3 years ago

Seems like Travis has shut off free access for open source projects. We'll need to move our tests to GitHub Actions.

atuttle commented 2 years ago

I've got the tests running (not passing) on actions: https://github.com/atuttle/Taffy/actions

Currently they only run for the branch feature/github-actions, so that we can get them all working before merging the change into main.

Most of the tests that are currently failing are the ones that make HTTP requests, and are currently getting status 500 responses. Some of the rest are failing because of the weird way the tests (are/must be) written to get around the fact that most of the configuration work is done in Application.cfc lifecycle hooks. (And because that old test code doesn't seem to jive with the current way things are configured...)

At the moment I'm not sure if we should continue to pursue reviving the old tests from the dead or start from scratch.

Also making things difficult is that in order to get the tests running in Actions I'm using @pixl8/github-action-box-test, which seems to be a great start for getting the testbox tests to run, but I'm not exactly sure how to make the same config run locally so that I can run the tests locally too without any changes.

And lastly, as far as I can tell, commandbox doesn't work on M1 macs yet. I installed with brew install commandbox and whenever I try to run box it throws a couple of java errors and shuts itself down.

I would love if others from the community could help get the tests running and passing.

atuttle commented 2 years ago

Well, after struggling with the existing stuff I decided to move it off to the side and start fresh.

I got a set of testbox tests running that runs and executes tests in 3 different contexts without modifications:

I'm pretty sure that for the latter two they require a CFML server with the Taffy folder as the web root, which I'll either provide a Dockerfile, and/or I'll make sure that server.json/box.json works to do a box server start and get what you need.

So now all that's left is to port over all of the existing tests. And I'm sure a lot of those will need rethinking. I've learned a lot about testing in the intervening ... checks watch... 4-10 years.

pfreitag commented 2 years ago

@atuttle commandbox does work on M1 macs, but not via homebrew for some reason, I think it might be more of a lucee issue that needs to be addressed. Anyways if you download the box + jre it will work.

Also reworking the tests sounds like to a good idea, I do have quite a bit of experience with Github Actions due to my work on fixinator, so happy to help if you have specific questions. Here are some examples: https://github.com/foundeo/cfml-ci-examples/blob/master/.github/workflows/ci.yml and here's an example using a Matrix (to test multiple CFML engines): https://github.com/foundeo/cfmatrix-example-pass/blob/master/.github/workflows/example.yml

atuttle commented 2 years ago

Appreciate the examples. Right now I'm just focusing on getting the tests working again. Then I'll worry about test matrices/etc. :)