Skip to content

tiltfile: refactor local target tests to use assertNextManifest style tests#2731

Merged
jazzdan merged 3 commits into
masterfrom
jazzdan/refactor_local_resource_tests_to_use_manifest_assertions
Jan 7, 2020
Merged

tiltfile: refactor local target tests to use assertNextManifest style tests#2731
jazzdan merged 3 commits into
masterfrom
jazzdan/refactor_local_resource_tests_to_use_manifest_assertions

Conversation

@jazzdan

@jazzdan jazzdan commented Jan 7, 2020

Copy link
Copy Markdown
Contributor

No description provided.

@jazzdan
jazzdan requested review from maiamcc and nicks January 7, 2020 16:53
switch matcher := matcher.(type) {
case updateCmdHelper:
assert.Equal(f.t, matcher.cmd, lt.UpdateCmd.String())
case depsHelper:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this needs a default case that calls Fatal()

Comment thread internal/tiltfile/tiltfile_test.go Outdated

mTop := f.loadResult.Manifests[1]
require.Equal(t, "toplvl-local", mTop.Name.String())
mTop := f.assertNextManifest("toplvl-local", lt(updateCmd("echo hello world"), deps(f.JoinPath("foo/baz"), f.JoinPath("foo/a.txt"))))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it might be simpler if the fixture does the JoinPaths?

Comment thread internal/tiltfile/tiltfile_test.go Outdated
return updateCmdHelper{cmd}
}

type ltHelper struct {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we spell this out as localTarget? i'm not sure i'd ever remember what lt meant without digging around. i would assume it meant "less than"

Comment thread pkg/model/manifest.go
switch di := m.deployTarget.(type) {
case DockerComposeTarget:
return di.LocalPaths()
case LocalTarget:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we panic() in the default case, to prevent this from getting missed in the future?

@jazzdan
jazzdan merged commit 7e57291 into master Jan 7, 2020
@nicks
nicks deleted the jazzdan/refactor_local_resource_tests_to_use_manifest_assertions branch February 3, 2022 16:56
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