friday-ai / friday

Friday is your open-source home automation assistant.
MIT License
1 stars 1 forks source link

Improve tests performance #94

Closed MathieuAndrade closed 1 year ago

MathieuAndrade commented 1 year ago

Replace seed function by this =>

const seedDb = async () => {
  const queryInterface = database.getQueryInterface();
  await promise.each(seeds, async (seed) => {
    await seed.up(queryInterface);
  });
};

const cleanDb = async () => {
  const queryInterface = database.getQueryInterface();
  await promise.each(reversedSeed, async (seed) => {
    await seed.down(queryInterface);
  });
};

https://github.com/friday-ai/friday/blob/cfd72f878bc847a7b0054018529d77cfae2b355a/server/test/utils/seed.ts#L18

Improve docker test images too (test of docker image start/stop is very long)