10 Commits

Author SHA1 Message Date
Jeff McCune
012de360ac component: pass write to directory as function args
Makes it easier to test and know for certain where the value is being
set from.  Previously it wasn't clear how the write to directory was
being modified or read in the global config object.
2025-05-21 14:27:02 -07:00
Jeff McCune
851ee2b33d component: refactor validator command for v1alpha6
This patch changes the behavior of all commands to execute in the
current working directory of the platform root cue module.  This gets
cue vet working well, otherwise it complains about fully qualified
paths.  The cue command line expects the current working directory to be
a cue module.

The Env field of the Command schema wasn't implemented, so we remove it
from the schema.  It's unclear it's necessary.  Setting the environment
in the parent context should suffice for current use cases.
2025-04-07 23:43:42 -07:00
Jeff McCune
063df94fed component: add test coverage for helm generator 2025-04-06 19:33:02 -07:00
Jeff McCune
3b2605aacc component: refactor to table test cases
Dry up the tests using a helper function to iterate over a simple
struct, they're all executing a component and validating the rendered
manifests against an expected data file.
2025-04-06 13:00:00 -07:00
Jeff McCune
5b5deca5d2 component: add test coverage for join transformer 2025-04-06 12:41:18 -07:00
Jeff McCune
9d92c292a6 component: refactor command and kustomize transformers
Previously the command and kustomize transformers were implemented as a
stand alone function.  The current method is to implement tasks as
methods on the generator, transformer, or validator structs.  This patch
refactors the stand alone functions to methods for consistency.

It also adds test coverage for the command and kustomize transformers.
2025-04-05 17:30:47 -07:00
Jeff McCune
3a205ccce7 component: test v1alpha6 Command generator directory support
This test validates the command generator stores a directory artifact
properly.
2025-04-04 17:13:07 -07:00
Jeff McCune
9597b313a4 component: test v1alpha6 Command generator
This patch adds a basic test of the v1alpha6 Command generator.
2025-04-04 15:59:56 -07:00
Jeff McCune
fafae89403 component: refactor to consistently use absolute paths
Testing is problematic because the current working directory is not the
platform root.  This patch refactors the codebase to consistently store
and use the platform root directory to construct absolute paths for
reading and writing files during a BuldPlan execution.
2025-04-04 13:29:52 -07:00
Jeff McCune
33bc8f8e23 component: add test coverage using testutils.Fixtures
There isn't good test coverage of the v1alpha6 component package
responsible for producing and executing a BuildPlan from a Component.
This patch adds test coverage using a shared testutils package using the
generate package to generate a v1alpha6 platform module, then copying
fixtures from the embedded testutils.Fixtures fs.FS.
2025-04-03 22:22:39 -07:00