[openstreetmap/openstreetmap-website] Re-enable JavaScript unit tests using Teaspoon (PR #5216)

Emin Kocan notifications at github.com
Sat Sep 14 16:29:08 UTC 2024


This pull request addresses #2595 , which involves re-enabling JavaScript unit tests. The goal is to restore JavaScript testing after the removal of Konacha. This work continues Andy's effort by cherry-picking commits from [his branch](https://github.com/gravitystorm/openstreetmap-website/tree/teaspoon), where the initial [Teaspoon](https://github.com/jejacks0n/teaspoon) integration began. 

#### Key Updates:
- **Teaspoon Integration**: Teaspoon has been configured to use Selenium WebDriver with Firefox (replacing PhantomJS, which is discontinued).
- **GitHub CI**: The GitHub test CI script has been updated to run JavaScript tests alongside the Rails tests.
- **ESLint Adjustments**: Added ESLint rules for the JavaScript test files in the `test` folder, fixing a few ESLint errors during the process.
  
At the moment, some tests are failing, you can look at the [logs](https://github.com/openstreetmap/openstreetmap-website/actions/runs/10863788529/job/30148346837) for more details. This could be due to changes in implementation or other issues that I am investigating. Any advice on how to approach this would be highly appreciated. I also faced some caching problems inside Docker, but those should be resolved now.

Note: This is still work in progress. I just wanted to get some feedback and to confirm this is going into right direction.



You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/5216

-- Commit Summary --

  * Use teaspoon to run javascript tests
  * Run javascript tests in CI
  * selenium driver working on local
  * Use chai assertion style
  * Disable eslint for js test files to test for github-ci
  * Add step for creation tmp/pids in test workflow
  * Enable eslint and fix eslint errors for osm_test.js

-- File Changes --

    M .github/workflows/tests.yml (4)
    M Gemfile (3)
    M Gemfile.lock (6)
    M config/eslint.js (12)
    M db/structure.sql (7)
    M test/javascripts/osm_test.js (26)
    A test/javascripts/test_helper.js (41)
    A test/teaspoon_env.rb (193)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/5216.patch
https://github.com/openstreetmap/openstreetmap-website/pull/5216.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5216
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5216 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240914/1b2837c1/attachment.htm>


More information about the rails-dev mailing list