resonatecoop / api

The one Resonate API to rule them all
GNU General Public License v3.0
15 stars 5 forks source link

fix: Issue 172 copy test audio files #195

Closed mattburnett-repo closed 1 year ago

mattburnett-repo commented 1 year ago

This PR only sorts out the 'copy test audio files' part of issue #172

Creating a container volume mapped to the 'test/media/' folder doesn't copy the test/media/ files. See this info: https://stackoverflow.com/questions/74520788/docker-compose-create-volume-and-copy-files-from-another-folder

It makes sense to combine the test file copy with the seeding process.

Added a small copy script (copy:testAudioFiles) to package.json and now call this copy script in docker:seed:all:test script, before running the seeders.

In the future, this approach can be expanded to include other test data files.

After this PR is merged, next is creating seeders for the test audio files.

mattburnett-repo commented 1 year ago

This specifically needs to be /data/media/audio. Since this is the media inside of the test container, we don't need to worry about it clashing with the "real data" folder (which, is the first half of this statement host:container). Also we want it to be the same route in the test container as in the normal containers, otherwise we have to add special code for test containers, which seems to defeat the purpose of containerization somewhat.

ah. My bad. I tried to change it inside of this PR (inside of github) but I'm not sure if it saved.

mattburnett-repo commented 1 year ago

does this succeed if the files already exist in data/media/audio? If it doesn't succeed does it fail all the next commands too?

I just now ran the script, with pre-existing files in 'data/media/audio' and it ran without problems

simonv3 commented 1 year ago

ah. My bad. I tried to change it inside of this PR (inside of github) but I'm not sure if it saved.

Looks like it didn't go through :/

mattburnett-repo commented 1 year ago

ah. My bad. I tried to change it inside of this PR (inside of github) but I'm not sure if it saved.

Looks like it didn't go through :/

ok. I pushed it again. let me know if that didn't work.

simonv3 commented 1 year ago

@mattburnett-repo I'm going to merge the above, but could you also run husky install in your folder so that it catches lint errors before pushing?