Этот коммит содержится в:
Ben Schumacher
2025-01-13 20:23:09 +01:00
коммит произвёл GitHub
родитель 091d1bba8b
Коммит 8d4bf4bae0
50 изменённых файлов: 2429 добавлений и 745 удалений

Просмотреть файл

@@ -115,8 +115,6 @@ func (s *MmctlE2ETestSuite) TestSupportPacketCmdF() {
s.Run("Download Support Packet with default filename", func() {
printer.Clean()
s.T().Cleanup(cleanupSupportPacket(s.T()))
err := systemSupportPacketCmdF(s.th.SystemAdminClient, SystemSupportPacketCmd, []string{})
s.Require().NoError(err)
s.Require().Len(printer.GetLines(), 2)
@@ -129,12 +127,17 @@ func (s *MmctlE2ETestSuite) TestSupportPacketCmdF() {
entries, err := os.ReadDir(".")
s.Require().NoError(err)
for _, e := range entries {
if strings.HasPrefix(e.Name(), "mattermost_support_packet_") && strings.HasSuffix(e.Name(), ".zip") {
if strings.HasPrefix(e.Name(), "mm_support_packet_") && strings.HasSuffix(e.Name(), ".zip") {
b, err := os.ReadFile(e.Name())
s.NoError(err)
s.NotEmpty(b, b)
s.T().Cleanup(func() {
err = os.Remove(e.Name())
s.Require().NoError(err)
})
found = true
}
}
@@ -144,14 +147,16 @@ func (s *MmctlE2ETestSuite) TestSupportPacketCmdF() {
s.Run("Download Support Packet with custom filename", func() {
printer.Clean()
err := SystemSupportPacketCmd.ParseFlags([]string{"-o", "foo.zip"})
systemSupportPacketCmd := &cobra.Command{}
systemSupportPacketCmd.Flags().StringP("output-file", "o", "", "Define the output file name")
err := systemSupportPacketCmd.ParseFlags([]string{"-o", "foo.zip"})
s.Require().NoError(err)
s.T().Cleanup(func() {
defer func() {
s.Require().NoError(os.Remove("foo.zip"))
})
}()
err = systemSupportPacketCmdF(s.th.SystemAdminClient, SystemSupportPacketCmd, []string{})
err = systemSupportPacketCmdF(s.th.SystemAdminClient, systemSupportPacketCmd, []string{})
s.Require().NoError(err)
s.Require().Len(printer.GetErrorLines(), 0)
s.Require().Len(printer.GetLines(), 2)