Pylons / deform

A Python HTML form library.
Other
416 stars 160 forks source link

Add GitHub Actions for matrix of Pythons and OSes, coverage, docs, an… #492

Closed stevepiercy closed 3 years ago

stevepiercy commented 3 years ago

…d lint

stevepiercy commented 3 years ago

@sydoluciani I'm flailing and have no idea how to get the functional web tests to run in GitHub Actions. All the other jobs succeed. I'm going to keep making random guesses until something works, but if you have any clue, I sure would appreciate it.

sydoluciani commented 3 years ago

@sydoluciani I'm flailing and have no idea how to get the functional web tests to run in GitHub Actions. All the other jobs succeed. I'm going to keep making random guesses until something works, but if you have any clue, I sure would appreciate it.

I am going to start working on it tomorrow. this would be my first time working with Github Actions, so it might take a bit of time. What is the benefit of moving from Travis-ci to Github Actions ? I guess every one is going to migrate.

sydoluciani commented 3 years ago

@stevepiercy, with a quick look at log files, and comparing travis.yml and .github/workflows/ci-tests.yml, I think we are missing this directive in travis.yml in ci-tests.yml.

That directive in travis.yml adds Firefox to container. Either we should install Firefox using apt-get, or finding the equivalant in Github action to add that service to container.

You can place an echo command, to make sure Firefox is installed and it is in path.

sydoluciani commented 3 years ago

Please add firefox to this line line and test.

sydoluciani commented 3 years ago

And we are missing this service as well.

Here is the example to set Xvfb.

export DISPLAY=:99
Xvfb :99 &
stevepiercy commented 3 years ago

Travis has severely restricted queueing on .org, increasing build times to several hours. It then limits OSS to 10,000 minutes of build time on .com, which most orgs will burn through during heavy usage such as releases and sprints. GHA has none of that nonsense for OSS. There is a discussion over in the Plone community where more details are available to verify. It's worth a read.

I'll make these changes and push in an hour or so. Although @sydoluciani you should be able to push commits to this branch. If not, please let me know. Thank you!

sydoluciani commented 3 years ago

@stevepiercy Tried it and failed again, trying again, will let you know if figured it out.

Do you have to merge it to run the test against my pull request ? If not, I am ok with the way it is, but if you have to merge to run the test , then I guess having access making it easier. I am trying to find out what is the problem and it might take a bit of time.

Plone seems to moving forward pretty good, how come plone didn't come under the Pyramid umbrella ? I was sad seeing their react frontend Volto working with Plone and not Pyramid, planning to join to see how we can get support for Pyramid or how we can add Volto like to Pyramid.

sydoluciani commented 3 years ago

@stevepiercy I think the way it is now, is better, I am going to remove all tests and only have the functional3 on this pull request, once figured it out, then you can only add the difference to your pull request. no need to run all tests when we are only working on functional3.

stevepiercy commented 3 years ago

@sydoluciani a PR against this branch will run GHA. Either way is fine, as long as you rebase your branch on this branch whenever I push new commits to this branch. I'll leave it alone for a while to give you some time to attempt a fix. Please let me know when you would like me to take the reins.

As far as Plone/Zope/Pylons, that's a long story. Briefly they all share a common root, but branched out in different directions. Now the organizations have begun to recombine. Zope is now under the Plone Foundation. Pylons Project has engaged in discussions to consider moving under the Plone Foundation. Pylons Project has no legal entity for collecting or disbursing funds and other organizational benefits, which is the primary motivation for us to seek such an entity.

sydoluciani commented 3 years ago

@stevepiercy somehow DISPLAY environment variable is not being set with normal shell command - run: export DISPLAY=:99 and firefox won't start with error message DISPLAY envrionment variable is not set. using different method in setting environment varialbe:

- env: 
                DISPLAY: 99

but tests are not being run any more, is there any restriction in running number of tests ?

sydoluciani commented 3 years ago

@stevepiercy My mistake, wrong place for env directive, tests started again. sill learning Github Action.

stevepiercy commented 3 years ago

I made many similar mistakes. :wink: We're both learning.

sydoluciani commented 3 years ago

Can you please stop this test forgot to add ampersand after firefox and now test is stuck after firefox started.

We added this line to differentiate between TRAVIS environment and local, but now that we are moving to Github Action, we should find an equivalent environment variable in Github Action. working on it.

stevepiercy commented 3 years ago

Done! https://github.com/Pylons/deform/runs/1368949761

sydoluciani commented 3 years ago

@stevepiercy Thank you, going to have dinner and have some fresh air. then I have to do some research to find an equivalanet for this line or maybe changing the logic a bit to be able to identify local tests than GHA environment.

will let you know as soon as I figured it out.

stevepiercy commented 3 years ago

Based on this output of nothing, I think your conclusion about DISPLAY not getting set is correct. I came to the realization that something or some things did not get set correctly when I paused my experiments. I'll put together a list of requirements, and then we can run down the list and verify what does and does not get set correctly.

stevepiercy commented 3 years ago

@sydoluciani I think I found something. Check this out: https://github.com/Pylons/deform/actions/runs/351953635 I think our concepts are correct, but our syntax and usage are just not quite right. We'll get there. I'll flail around at this until I find the right combination.

stevepiercy commented 3 years ago

YES! https://github.com/Pylons/deform/runs/1369554799?check_suite_focus=true#step:4:8

stevepiercy commented 3 years ago

It appears that ubuntu comes with firefox and xvfb pre-installed. See https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md

Right now it gets hung up on starting xvfb. I tried both with and without sudo. I have seen posts where it is installed as a service. More searching and reading to do.

stevepiercy commented 3 years ago

Aha! xvfb-run not xvfb!

Also discovered that the scope of env vars is limited to only the step in which they are set.

stevepiercy commented 3 years ago

I'm not sure whether xvfb or xfvb-run is the correct command, but I think this recent work gets us closer.

stevepiercy commented 3 years ago

Some more things to try from the Keybase chat: keybase://chat/pylons#general/397 I'll be away for the next day, but feel free to try them out.