This message was deleted.
# help
s
This message was deleted.
t
So agreed lambda could be a great fit here, the issues come with you need to get your code from github or where ever onto the lambda, install the dependencies and run the tests. so make sure you factor in that first bit into your time saved calculation
Also the lambda code could look something like this
Copy code
const execSync = require('child_process').execSync;

module.exports.handler = async (event, context) => {
  execSync('rm -rf /tmp/*')
  execSync('cd /tmp && git clone <https://github.com/me/my-project.git>');
  execSync('cd /tmp/my-project && npm install --force');
  execSync('cd /tmp/my-project && npm run test');

  return 'successful invocation';
};
You also need to do a bit of wrangling to make sure npm knows it can only write to tmp
this was also just for a public project so cloning it is easier, you also need to add creds for a private project. I used this layer https://github.com/lambci/git-lambda-layer
d
Nice!
c
ive heard great things about jest-carnival but you should be able to run thousands of tests fairly quickly if you mess around with jest worker settings
such as setting the
maxWorkers
prop
d
Thanks!