hackforla / website

Hack for LA's website
https://www.hackforla.org
GNU General Public License v2.0
324 stars 768 forks source link

Research and Provide a Demo of Unit Testing for GHAs #7151

Open roslynwythe opened 3 months ago

roslynwythe commented 3 months ago

Dependency

Overview

We need to develop a sample set of unit tests against the JavaScript code in HfLA GitHub Actions, along with a new workflow that will invoke the tests in response to push and pull request triggers, in order to implement a GitHub PR check that will help ensure the quality of GHA code.

Action Items

Resources/Instructions

https://jasmine.github.io/ https://raygun.com/blog/javascript-unit-testing-frameworks/ https://www.browserstack.com/guide/jest-vs-mocha-vs-jasmine How to Test a GitHub Action with GitHub Actions Publish and view Mocha test results in Github Actions Test workflow from Mocha examples

github-actions[bot] commented 3 months ago

Hi @roslynwythe.

Please don't forget to add the proper labels to this issue. Currently, the labels for the following are missing:

NOTE: Please ignore this comment if you do not have 'write' access to this directory.

To add a label, take a look at Github's documentation here.

Also, don't forget to remove the "missing labels" afterwards. To remove a label, the process is similar to adding a label, but you select a currently added label to remove it.

After the proper labels are added, the merge team will review the issue and add a "Ready for Prioritization" label once it is ready for prioritization.

Additional Resources:

roslynwythe commented 3 months ago

@t-will-gillis Your advice would be appreciated. Is it a good idea to take on this issue now, or should we wait until the current GHA changes settle down? And, are there any particular unit tests that you would like to suggest, or general guidelines for selecting sample unit tests? We can discuss at tomorrow's meeting if you would like.

I tend to think that the task related to local testing using netkos/act should be in a separate issue that has a dependency on this one. Do you agree?

HackforLABot commented 3 months ago

Hi @roslynwythe, thank you for taking up this issue! Hfla appreciates you :)

Do let fellow developers know about your:- i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?) ii. ETA: (When do you expect this issue to be completed?)

You're awesome!

P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)

roslynwythe commented 2 months ago

I removed the action item regarding locally testing using https://github.com/nektos/act because it is not essential for unit testing on GitHub, and it seemed appropriate for a follow-up issue.

HackforLABot commented 1 month ago

Hi @t-will-gillis, thank you for taking up this issue! Hfla appreciates you :)

Do let fellow developers know about your:- i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?) ii. ETA: (When do you expect this issue to be completed?)

You're awesome!

P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)

ExperimentsInHonesty commented 1 month ago

@t-will-gillis

  1. Identify which GHA to test
  2. any particular unit tests that you would like to suggest, or general guidelines for selecting sample unit tests
  3. Does a separate issue need to be made for ocally testing using https://github.com/nektos/act and does it come before or after this issue
t-will-gillis commented 1 month ago

Update: I am still researching how we might do unit testing with the GHAs.

The issues for the Dependency to this issue are created, but will likely be added to.