Skip to content
Merged
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
6 changes: 6 additions & 0 deletions acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@ func testAccept(t *testing.T, inprocessMode bool, singleTest string) int {
t.Setenv("CLI", execPath)
repls.SetPath(execPath, "[CLI]")

pipelinesPath := filepath.Join(buildDir, "pipelines") + exeSuffix
err = copyFile(execPath, pipelinesPath)
require.NoError(t, err)
t.Setenv("PIPELINES", pipelinesPath)
repls.SetPath(pipelinesPath, "[PIPELINES]")

paths := []string{
// Make helper scripts available
filepath.Join(cwd, "bin"),
Expand Down
10 changes: 3 additions & 7 deletions acceptance/pipelines/init/error-cases/output.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@

=== Install pipelines CLI
>>> errcode [CLI] install-pipelines-cli -d ./subdir
pipelines successfully installed in directory "./subdir"

=== Test with missing config file
>>> errcode ./subdir/pipelines init --output-dir output
>>> errcode [PIPELINES] init --output-dir output

Welcome to the template for pipelines!

Expand All @@ -14,13 +10,13 @@ Your new project has been created in the 'my_project' directory!
Refer to the README.md file for "getting started" instructions!

=== Test with invalid project name (contains uppercase letters)
>>> errcode ./subdir/pipelines init --config-file ./invalid_input.json --output-dir invalid-output
>>> errcode [PIPELINES] init --config-file ./invalid_input.json --output-dir invalid-output
Error: failed to load config from file ./invalid_input.json: invalid value for project_name: "InvalidProjectName". Name must consist of lower case letters, numbers, and underscores.

Exit code: 1

=== Test with non-existent config file
>>> errcode ./subdir/pipelines init --config-file ./nonexistent.json --output-dir invalid-output-2
>>> errcode [PIPELINES] init --config-file ./nonexistent.json --output-dir invalid-output-2
Error: failed to load config from file ./nonexistent.json: open ./nonexistent.json: no such file or directory

Exit code: 1
15 changes: 3 additions & 12 deletions acceptance/pipelines/init/error-cases/script
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
tmpdir="./subdir"
pipelines="$tmpdir/pipelines"
mkdir -p $tmpdir

title "Install pipelines CLI"
trace errcode $CLI install-pipelines-cli -d $tmpdir

title "Test with missing config file"
trace errcode $pipelines init --output-dir output
trace errcode $PIPELINES init --output-dir output

title "Test with invalid project name (contains uppercase letters)"
echo '{"project_name": "InvalidProjectName"}' > invalid_input.json
trace errcode $pipelines init --config-file ./invalid_input.json --output-dir invalid-output
trace errcode $PIPELINES init --config-file ./invalid_input.json --output-dir invalid-output

title "Test with non-existent config file"
trace errcode $pipelines init --config-file ./nonexistent.json --output-dir invalid-output-2
trace errcode $PIPELINES init --config-file ./nonexistent.json --output-dir invalid-output-2

# Do not affect this repository's git behaviour
mv output/my_project/.gitignore output/my_project/out.gitignore

# Clean up
rm -f invalid_input.json
rm -f $pipelines
rm -rf $tmpdir
6 changes: 1 addition & 5 deletions acceptance/pipelines/init/python/output.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@

=== Install pipelines CLI
>>> errcode [CLI] install-pipelines-cli -d ./subdir
pipelines successfully installed in directory "./subdir"

=== Test basic pipelines init with configuration file
>>> ./subdir/pipelines init --config-file ./input.json --output-dir output
>>> [PIPELINES] init --config-file ./input.json --output-dir output

Welcome to the template for pipelines!

Expand Down
12 changes: 1 addition & 11 deletions acceptance/pipelines/init/python/script
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
tmpdir="./subdir"
pipelines="$tmpdir/pipelines"
mkdir -p $tmpdir

title "Install pipelines CLI"
trace errcode $CLI install-pipelines-cli -d $tmpdir

title "Test basic pipelines init with configuration file"
trace $pipelines init --config-file ./input.json --output-dir output
trace $PIPELINES init --config-file ./input.json --output-dir output

mv output/my_python_project/.gitignore output/my_python_project/out.gitignore

rm -f $pipelines
rm -rf $tmpdir
6 changes: 1 addition & 5 deletions acceptance/pipelines/init/sql/output.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@

=== Install pipelines CLI
>>> errcode [CLI] install-pipelines-cli -d ./subdir
pipelines successfully installed in directory "./subdir"

=== Test pipelines init with SQL configuration
>>> ./subdir/pipelines init --config-file ./input.json --output-dir output
>>> [PIPELINES] init --config-file ./input.json --output-dir output

Welcome to the template for pipelines!

Expand Down
12 changes: 1 addition & 11 deletions acceptance/pipelines/init/sql/script
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
tmpdir="./subdir"
pipelines="$tmpdir/pipelines"
mkdir -p $tmpdir

title "Install pipelines CLI"
trace errcode $CLI install-pipelines-cli -d $tmpdir

title "Test pipelines init with SQL configuration"
trace $pipelines init --config-file ./input.json --output-dir output
trace $PIPELINES init --config-file ./input.json --output-dir output

# Do not affect this repository's git behaviour
mv output/my_sql_project/.gitignore output/my_sql_project/out.gitignore

rm -f $pipelines
rm -rf $tmpdir
Loading