32/71
Sign inSign up free

809. Clean Up and Report, Even When Tests Fail

medium 20 XP ~8 minHands-on lab

The e2e job in /home/student/repos/storefront/.github/workflows/e2e.yml starts a test environment, runs the tests, then tears the environment down. When the tests fail, the steps after them are skipped: the environment keeps running (and costing money), and nobody can see the test logs.

Task

Change the steps so that:

  • "Tear down environment" runs whether the tests passed, failed or the run was cancelled,
  • "Upload logs" runs only when an earlier step failed,
  • "Notify success" runs only when everything before it succeeded (as now),
  • the job still ends failed when the tests fail (don't hide failures with continue-on-error).

About this machine

Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.