mu-semtech / mu-javascript-template

Template for running javascript/express microservices
4 stars 17 forks source link

add a "test" mode #30

Closed nvdk closed 2 years ago

nvdk commented 3 years ago

this mode works differently from dev in that it creates a merged package.json file, so we have both the dependencies of the template and of the app available. In case of overlapping keys the values from the app are preferred over those from the template. This is typically a requirement to successfully run tests, and may also be considered as a sane approach for the dev script.

Merging of the package.json files is done using jq's multiply function and probably has some limitations I'm currently not aware of. So far it seems to be working.

nvdk commented 3 years ago

~this still has an issue where the shell doesn't quit after running the tests, haven't figured out why yet.~ this has been solved

madnificent commented 3 years ago

Hi @nvdk. I would like to let this issue blow up :-)

This seems to be strongly related to the dev setup issue you have with the 'mu' package in this package as well as in the mu-semtech/mu-ruby-template package. Your aim was to have a dev setup that would also be installable by regular scripts.

My understanding is that a published package would help solve some issues. With the slowly evolving branding to semantic.works, we could make a shift to published packages perhaps. A first ideation leads to publishing a 'semantic-works' npm package from which the current imports can happen (query, app, sparqlEscapeString, ...). The template may depend on more than only that package, hence we could publish a package that contains all dependencies in lockstep with the template's version.

Such approach would mean we can execute this merge on all environments. For backwards compatibility, we could keep supporting the current mu imports as well, though we might require an upgrade if you want to use this tests feature.

Does this approach sound reasonable? Is ticket more urgent right now? If you expect further discussion on this topic specifically, I suggest we move the discussion into a separate issue on mu-semtech/mu-project.

nvdk commented 3 years ago

We're currently running on a fork of the javascript template that has this feature, so there is no urgency anymore. I do think you could still see things separately (that is if the template should offer testing capabilities). I agree the discussion on the future templates would fit better as an issue mu-project.

erikap commented 2 years ago

Replaced by #29, #43 and #44 .