Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement: Add mod-plugin to default tasks #768

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-768.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Add mod-plugin to default tasks
links:
- https://github.com/palantir/godel/pull/768
13 changes: 13 additions & 0 deletions framework/godellauncher/defaulttasks/defaulttasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,19 @@ var defaultPluginsConfig = config.PluginsConfig{
}),
}),
},
{
LocatorWithResolverConfig: config.ToLocatorWithResolverConfig(config.LocatorWithResolverConfig{
Locator: config.ToLocatorConfig(config.LocatorConfig{
ID: "com.palantir.godel-mod-plugin:mod-plugin:1.33.0",
Checksums: map[string]string{
"darwin-amd64": "ccc2d3e011108ab5610281b31cd1bdcb04f76c346f957882dc747e90ad4de29d",
"darwin-arm64": "e8497f8ab8ebf09be3e43f0ebc9d5f958f848c58a4f3b1a12e2174009c3f5d2f",
"linux-amd64": "97e97d474dbf08708bbb6e494699e0fe174cfb31bd6e0526f87804dffd1d97a5",
"linux-arm64": "03cc1a89d2fc6820a8ff0ac7e2774c932ee0afad9ef2801fc3300e73a7ca8a34",
},
}),
}),
},
}),
}

Expand Down
8 changes: 4 additions & 4 deletions integration_test/integration_verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func TestFoo(t *testing.T) {
args []string
want string
}{
{want: `(?s).+Failed tasks:\n\tformat --verify\n\tlicense --verify\n\tcheck\n\ttest`},
{want: `(?s).+Failed tasks:\n\tformat --verify\n\tmod --verify\n\tlicense --verify\n\tcheck\n\ttest`},
{args: []string{"--skip-format"}, want: `(?s).+Failed tasks:\n\tlicense --verify\n\tcheck\n\ttest`},
{args: []string{"--skip-check"}, want: `(?s).+Failed tasks:\n\tformat --verify\n\tlicense --verify\n\ttest`},
{args: []string{"--skip-license"}, want: `(?s).+Failed tasks:\n\tformat --verify\n\tcheck\n\ttest`},
Expand Down Expand Up @@ -280,7 +280,7 @@ func TestFooIntegration(t *testing.T) {}
require.NoError(t, err)

// run verify with "none" tags. Should include output for main package but not for integration_test package.
cmd := exec.Command("./godelw", "verify", "--apply=false", "--tags=none")
cmd := exec.Command("./godelw", "verify", "--skip-mod", "--apply=false", "--tags=none")
cmd.Dir = testProjectDir
output, err := cmd.CombinedOutput()
outputStr := string(output)
Expand All @@ -289,7 +289,7 @@ func TestFooIntegration(t *testing.T) {}
assert.NotRegexp(t, fmt.Sprintf(`(?s).+%s\s+[0-9.]+s.+`, files["integration_tests/integration_test.go"].ImportPath), outputStr)

// run verify with "all" tags. Should include output for integration_test package but not for main package.
cmd = exec.Command("./godelw", "verify", "--apply=false", "--tags=all")
cmd = exec.Command("./godelw", "verify", "--skip-mod", "--apply=false", "--tags=all")
cmd.Dir = testProjectDir
output, err = cmd.CombinedOutput()
outputStr = string(output)
Expand All @@ -298,7 +298,7 @@ func TestFooIntegration(t *testing.T) {}
assert.NotRegexp(t, fmt.Sprintf(`(?s).+%s\s+[0-9.]+s.+`, files["main.go"].ImportPath), outputStr)

// run verify in regular mode. Should include output for all tests.
cmd = exec.Command("./godelw", "verify", "--apply=false")
cmd = exec.Command("./godelw", "verify", "--skip-mod", "--apply=false")
cmd.Dir = testProjectDir
output, err = cmd.CombinedOutput()
outputStr = string(output)
Expand Down
12 changes: 6 additions & 6 deletions integration_test/plugins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ plugins:
wantOutput = fmt.Sprintf("--project-dir %s --godel-config %s/godel/config/godel.yml --config %s/godel/config/%s.yml echo foo --bar baz\n", testProjectDir, testProjectDir, testProjectDir, pluginName)
assert.Equal(t, wantOutput, gotOutput)

gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-test")
gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-mod", "--skip-test")
wantOutput = fmt.Sprintf(`Running format...
Running echo-task...
--project-dir %s --godel-config %s/godel/config/godel.yml --config %s/godel/config/%s.yml echo
`, testProjectDir, testProjectDir, testProjectDir, pluginName)
assert.Equal(t, wantOutput, gotOutput)

gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-test", "--apply=false")
gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-mod", "--skip-test", "--apply=false")
wantOutput = fmt.Sprintf(`Running format...
Running echo-task...
--project-dir %s --godel-config %s/godel/config/godel.yml --config %s/godel/config/%s.yml echo --verify
Expand Down Expand Up @@ -168,14 +168,14 @@ plugins:
wantOutput = fmt.Sprintf("--project-dir %s --godel-config %s/godel/config/godel.yml --config %s/godel/config/%s.yml --assets %s echo foo --bar baz\n", testProjectDir, testProjectDir, testProjectDir, pluginName, assetPath)
assert.Equal(t, wantOutput, gotOutput)

gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-test")
gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-mod", "--skip-test")
wantOutput = fmt.Sprintf(`Running format...
Running echo-task...
--project-dir %s --godel-config %s/godel/config/godel.yml --config %s/godel/config/%s.yml --assets %s echo
`, testProjectDir, testProjectDir, testProjectDir, pluginName, assetPath)
assert.Equal(t, wantOutput, gotOutput)

gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-test", "--apply=false")
gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-mod", "--skip-test", "--apply=false")
wantOutput = fmt.Sprintf(`Running format...
Running echo-task...
--project-dir %s --godel-config %s/godel/config/godel.yml --config %s/godel/config/%s.yml --assets %s echo --verify
Expand Down Expand Up @@ -237,14 +237,14 @@ tasks-config-providers:
wantOutput = fmt.Sprintf("--project-dir %s --godel-config %s/godel/config/godel.yml --config %s/godel/config/%s.yml echo foo --bar baz\n", testProjectDir, testProjectDir, testProjectDir, pluginName)
assert.Equal(t, wantOutput, gotOutput)

gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-test")
gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-mod", "--skip-test")
wantOutput = fmt.Sprintf(`Running format...
Running echo-task...
--project-dir %s --godel-config %s/godel/config/godel.yml --config %s/godel/config/%s.yml echo
`, testProjectDir, testProjectDir, testProjectDir, pluginName)
assert.Equal(t, wantOutput, gotOutput)

gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-test", "--apply=false")
gotOutput = execCommand(t, testProjectDir, "./godelw", "verify", "--skip-check", "--skip-license", "--skip-mod", "--skip-test", "--apply=false")
wantOutput = fmt.Sprintf(`Running format...
Running echo-task...
--project-dir %s --godel-config %s/godel/config/godel.yml --config %s/godel/config/%s.yml echo --verify
Expand Down