MuditaOS icon indicating copy to clipboard operation
MuditaOS copied to clipboard

Development workflow: Unit testing for scripts required

Open GravisZro opened this issue 3 years ago • 3 comments
trafficstars

⚠️ Development workflow: Unit testing for scripts required

📝 Description

There are no method of unit testing scripts. As a result, pull requests that modify scripts are viewed as risky and therefore left to languish indefinitely. Being able to test script changes in an automated fashion is necessary to enable trust in community originating fixes.

📝 Describe the solution you'd like

An additional unit testing target group (e.g. make scriptcheck) should be made. Additionally, Jenkins should run it (only) when a script file is modified. It is advisable to use an existing script unit testing framework.

📝 Describe alternatives you've considered

Refuse all pull requests involving scripts from community members.

GravisZro avatar Jun 06 '22 16:06 GravisZro

Unfortunately, I'm afraid it will be very time-consuming right now and we just straight do not have the capacity to do so. What's more - it's a nontrivial task as writing tests for ready-to-go software is always harder. Even organizing the environment for script testing is a nontrivial matter for us. Do you happen to have know-how on how we could achieve it?

pholat avatar Jun 07 '22 08:06 pholat

Shellspec seems like a good fit since there is no need to test the internal functionality when all that is required is to verify the script behavior.

GravisZro avatar Jun 07 '22 11:06 GravisZro

@GravisZro Can you provide an example script based on our existing script? For example our bootstrap.sh?

kkleczkowski avatar Jun 13 '22 10:06 kkleczkowski

@GravisZro We don't have that many scripts, and implementing this feature seems to be non-trivial and time consuming, so currently we won't be implementing it. We'll let you know if anything changes in that matter.

Lefucjusz avatar Aug 22 '22 10:08 Lefucjusz