Skip to content

feat: show better error on invalid template upload #3847

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

Merged
merged 2 commits into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Fix tests
  • Loading branch information
ammario committed Sep 2, 2022
commit 0a45eb2098ed15d4073a1e900bf974edf40a8361
4 changes: 4 additions & 0 deletions cli/clitest/clitest.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"bytes"
"errors"
"io"
"io/ioutil"
"os"
"path/filepath"
"testing"
Expand Down Expand Up @@ -52,6 +53,9 @@ func SetupConfig(t *testing.T, client *codersdk.Client, root config.Root) {
// new temporary testing directory.
func CreateTemplateVersionSource(t *testing.T, responses *echo.Responses) string {
directory := t.TempDir()
f, err := ioutil.TempFile(directory, "*.tf")
require.NoError(t, err)
f.Close()
data, err := echo.Tar(responses)
require.NoError(t, err)
extractTar(t, data, directory)
Expand Down
2 changes: 1 addition & 1 deletion provisionersdk/archive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestTar(t *testing.T) {
func TestUntar(t *testing.T) {
t.Parallel()
dir := t.TempDir()
file, err := os.CreateTemp(dir, "")
file, err := os.CreateTemp(dir, "*.tf")
require.NoError(t, err)
_ = file.Close()
archive, err := provisionersdk.Tar(dir, 1024)
Expand Down
2 changes: 1 addition & 1 deletion pty/ptytest/ptytest.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (p *PTY) ExpectMatch(str string) string {
p.logf("matched %q = %q", str, buffer.String())
return buffer.String()
case <-timeout.Done():
// Ensure goroutine is cleaned up before test exit.
// Ensure gorouine is cleaned up before test exit.
_ = p.out.closeErr(p.Close())
<-match

Expand Down