goss-org / goss

Quick and Easy server testing/validation
https://goss.rocks
Apache License 2.0
5.5k stars 470 forks source link

Added ctx object to all system struct's methods #836

Closed aelsabbahy closed 9 months ago

aelsabbahy commented 10 months ago

The idea behind this commit is to set the stage for the following features:

Checklist

Description of change

Busy PR, lots of boring work to wire this up.. but hopefully this opens the door for some future features/flexibility.

One thing I wasn't 100% sure on is whether to have Validate() take ctx, or it instantiates it based on the yaml config.

My high level thoughts are:

Possible alternatives

Pass ctx only to the constructors, that would bring a lot of simplicity to the codebase as most of it would remain unchanged. Also, don't think any of the system resources have methods that require different timeouts.

I'll create another simpler PR with that approach and we can discuss how they compare.

aelsabbahy commented 9 months ago

went with #837 instead