From 25bbf61542a83400ae6368a9b8ccdb18dada844a Mon Sep 17 00:00:00 2001 From: dittrichlucas Date: Wed, 27 Oct 2021 14:05:51 -0300 Subject: [PATCH] test: add functional tests for error cases in credential commands Signed-off-by: dittrichlucas --- .../workflows/test-credential-commands.yml | 64 ++++++++++++++++++- .../credential_workflow/assert3.txt | 1 + 2 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 testdata/gha_workflows/credential_workflow/assert3.txt diff --git a/.github/workflows/test-credential-commands.yml b/.github/workflows/test-credential-commands.yml index 9fa6dbc72..744a011a8 100644 --- a/.github/workflows/test-credential-commands.yml +++ b/.github/workflows/test-credential-commands.yml @@ -82,7 +82,27 @@ jobs: command_line: rit list credential assert_file_path: testdata/gha_workflows/credential_workflow/assert1.txt expected_result: PASSED - + - name: RIT SET CREDENTIAL command ERROR (3) + uses: GuillaumeFalourd/test-cli-commands-action@v1 + with: + command_line: rit set credential --flag=test + assert_file_path: testdata/gha_workflows/credential_workflow/assert3.txt + expected_result: PASSED + specific_line: 1 + - name: RIT DELETE CREDENTIAL command ERROR (4) + uses: GuillaumeFalourd/test-cli-commands-action@v1 + with: + command_line: rit delete credential --flag=test + assert_file_path: testdata/gha_workflows/credential_workflow/assert3.txt + expected_result: PASSED + specific_line: 1 + - name: RIT DELETE CREDENTIAL command ERROR (5) + uses: GuillaumeFalourd/test-cli-commands-action@v1 + with: + command_line: rit delete credential --env=new_test + contains: no such file or directory + expected_result: PASSED + macos: runs-on: macos-latest steps: @@ -117,7 +137,27 @@ jobs: command_line: rit list credential assert_file_path: testdata/gha_workflows/credential_workflow/assert1.txt expected_result: PASSED - + - name: RIT SET CREDENTIAL command ERROR (3) + uses: GuillaumeFalourd/test-cli-commands-action@v1 + with: + command_line: rit set credential --flag=test + assert_file_path: testdata/gha_workflows/credential_workflow/assert3.txt + expected_result: PASSED + specific_line: 1 + - name: RIT DELETE CREDENTIAL command ERROR (4) + uses: GuillaumeFalourd/test-cli-commands-action@v1 + with: + command_line: rit delete credential --flag=test + assert_file_path: testdata/gha_workflows/credential_workflow/assert3.txt + expected_result: PASSED + specific_line: 1 + - name: RIT DELETE CREDENTIAL command ERROR (5) + uses: GuillaumeFalourd/test-cli-commands-action@v1 + with: + command_line: rit delete credential --env=new_test + contains: no such file or directory + expected_result: PASSED + windows: runs-on: windows-latest steps: @@ -153,3 +193,23 @@ jobs: command_line: ./rit.exe list credential assert_file_path: testdata/gha_workflows/credential_workflow/assert1.txt expected_result: PASSED + - name: RIT SET CREDENTIAL command ERROR (3) + uses: GuillaumeFalourd/test-cli-commands-action@v1 + with: + command_line: ./rit.exe set credential --flag=test + assert_file_path: testdata/gha_workflows/credential_workflow/assert3.txt + expected_result: PASSED + specific_line: 1 + - name: RIT DELETE CREDENTIAL command ERROR (4) + uses: GuillaumeFalourd/test-cli-commands-action@v1 + with: + command_line: ./rit.exe delete credential --flag=test + assert_file_path: testdata/gha_workflows/credential_workflow/assert3.txt + expected_result: PASSED + specific_line: 1 + - name: RIT DELETE CREDENTIAL command ERROR (5) + uses: GuillaumeFalourd/test-cli-commands-action@v1 + with: + command_line: ./rit.exe delete credential --env=new_test + contains: no such file or directory + expected_result: PASSED diff --git a/testdata/gha_workflows/credential_workflow/assert3.txt b/testdata/gha_workflows/credential_workflow/assert3.txt new file mode 100644 index 000000000..c3712cffa --- /dev/null +++ b/testdata/gha_workflows/credential_workflow/assert3.txt @@ -0,0 +1 @@ +Error: unknown flag: --flag