MCPcopy Create free account
hub / github.com/bufbuild/buf / TestWorkspaceWithInvalidArchivePathFail

Function TestWorkspaceWithInvalidArchivePathFail

cmd/buf/workspace_test.go:1573–1611  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1571}
1572
1573func TestWorkspaceWithInvalidArchivePathFail(t *testing.T) {
1574 if runtime.GOOS == "windows" {
1575 // TODO FUTURE: failing test, fix on windows, there is temp dir clean-up fail, a reference to archive.zip not closed
1576 t.Skip()
1577 }
1578 // The --path flag did not reference a file found in the archive.
1579 zipDir := createZipFromDir(
1580 t,
1581 filepath.Join("testdata", "workspace", "success", "dir"),
1582 "archive.zip",
1583 )
1584 testRunStdoutStderrNoWarn(
1585 t,
1586 nil,
1587 1,
1588 ``,
1589 `Failure: `+bufmodule.ErrNoTargetProtoFiles.Error(),
1590 "lint",
1591 filepath.Join(zipDir, "archive.zip#subdir=proto"),
1592 "--path",
1593 filepath.Join("proto", "notexist"),
1594 )
1595 zipDir = createZipFromDir(
1596 t,
1597 filepath.Join("testdata", "workspace", "success", "v2", "dir"),
1598 "archive.zip",
1599 )
1600 testRunStdoutStderrNoWarn(
1601 t,
1602 nil,
1603 1,
1604 ``,
1605 `Failure: `+bufmodule.ErrNoTargetProtoFiles.Error(),
1606 "lint",
1607 filepath.Join(zipDir, "archive.zip#subdir=proto"),
1608 "--path",
1609 filepath.Join("proto", "notexist"),
1610 )
1611}
1612
1613func TestWorkspaceWithInvalidArchiveAbsolutePathFail(t *testing.T) {
1614 if runtime.GOOS == "windows" {

Callers

nothing calls this directly

Calls 3

createZipFromDirFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…