1

I am running the following code in a ci/cd pipeline:

sls offline start --showDuration --exec "npm run int-test"

However, when a test fails, the ci/cd pipeline does not fail because the failure of a test is not trickling down to the script, which is serverless offline exec is not passing the exit code.

I could get past this if I had a way of shutting down serverless offline in the pipeline. I could start the server, run tests, shut down the server. However, I cannot find a stop command for serverless offline, and Ctrl-C is no an option cause I am running in the pipeline, not on a terminal.

Suggestions on getting either of these solutions to work? Right now my pipeline thinks my tests are passing...

ed4becky
  • 1,488
  • 1
  • 17
  • 54

1 Answers1

0

Try removing the start option of that command. For what I understand from this Github issue it might be the solution for that particular problem. It helped me with something similar.

Josemy
  • 810
  • 1
  • 12
  • 29
  • Unfortunately, that did not work for me on versions `Framework Core: 2.6.0 (local) Plugin: 4.0.4 SDK: 2.3.2 Components: 3.2.1` – Jarno Jan 16 '21 at 08:39