Skip to content

Add tests for generating Kitfiles.#693

Merged
amisevsk merged 3 commits intokitops-ml:mainfrom
amisevsk:kitfile-generation-tests
Jan 16, 2025
Merged

Add tests for generating Kitfiles.#693
amisevsk merged 3 commits intokitops-ml:mainfrom
amisevsk:kitfile-generation-tests

Conversation

@amisevsk
Copy link
Copy Markdown
Contributor

Description

Add test cases for generating Kitfiles. Should probably also include a test for license detection but it's harder to fit into the framework we've got.

Linked issues

Related: #124, #564

@amisevsk amisevsk requested a review from gorkem January 15, 2025 00:36
Comment thread testing/generate-kitfile_test.go Outdated
t.Run(fmt.Sprintf("%s (%s)", tt.Name, tt.Description), func(t *testing.T) {
// Set up temporary directory for work
tmpDir, removeTmp := setupTempDir(t)
defer removeTmp()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if t.Cleanup() works better.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It certainly does, and this is me learning about its existence :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated all our tests to use cleanup, much cleaner

To ensure generated Kitfiles are consistent, generate Kitfiles that
always use the forward slash ('/') as a path separator. This means
replacing slashes in windows-style paths with forward-slashes.
@amisevsk amisevsk force-pushed the kitfile-generation-tests branch from 5db3eab to e998dc2 Compare January 16, 2025 20:14
@amisevsk amisevsk merged commit 297fd55 into kitops-ml:main Jan 16, 2025
@amisevsk amisevsk deleted the kitfile-generation-tests branch January 16, 2025 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants