WordPress / openverse

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
https://openverse.org
MIT License
239 stars 190 forks source link

Add unit tests for Python and JS automation scripts #1916

Open sarayourfriend opened 1 year ago

sarayourfriend commented 1 year ago

Problem

We need unit tests to verify that output is as expected given specific inputs, as made obvious by the various (incomplete) attempts to fix the changelog workflow generation script: https://github.com/WordPress/openverse/pull/1914#discussion_r1178576092

Description

Add unit tests to the automation scripts. This will require re-writing them to make them unit testable (export a function that can be called, etc).

dhruvkb commented 9 months ago

We've slowly ported almost all Python scripts over to JS. Once they're all consistently using the same structure (MJS files with main invoked by actions/github-script), we can add unit tests for them and the functions they call. It's all coming together 👍 (but slowly)!