Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
Update functional tests using the test-cli-commands-action (#968)
Browse files Browse the repository at this point in the history
* test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* add test workflow push

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* generated checkout workflow file

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-gloabl-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* generated output.txt file

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* generated check1.txt file

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* generated output.txt file

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* generated output.txt file

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* generated output.txt file

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* generated output.txt file

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* generated output.txt file

* generated output.txt file

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-global-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-env-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* generated output.txt file

* update test-credential-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* generated output.txt file

* update test-credential-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* generated output.txt file

* update test-credential-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* generated output.txt file

* update test-repo-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test-repo-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* generated output.txt file

* update test-repo-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* generated output.txt file

* update test-repo-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* generated output.txt file

* update test-repo-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* generated output.txt file

* generated output.txt file

* update test-repo-commands workflow with new action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update testData folder and files

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update testData folder and files for repo_workflow

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* test BASH and PWSH difference

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* test BASH and PWSH difference

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* test BASH and PWSH difference

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* test BASH and PWSH difference

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* test BASH and PWSH difference

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* test workflow with new action version

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* add node to ubuntu runners

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test credential commands

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test env commands

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test global commands

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test repo commands

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test global commands

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test repo and envcommands

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update test credential commands

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update functional test setup for node in workflows

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* update rit list repo command for macos functionnal tests

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* remove rit list repo fake call

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* add sleep 3s

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

* add specific line to check

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>

Co-authored-by: github-actions <github-actions@github.com>
  • Loading branch information
GuillaumeFalourd and github-actions committed Jun 24, 2021
1 parent 623ada5 commit 5780deb
Show file tree
Hide file tree
Showing 8 changed files with 766 additions and 289 deletions.
100 changes: 51 additions & 49 deletions .github/workflows/test-credential-commands.yml
Expand Up @@ -28,6 +28,7 @@ on:
- '**/set_test.go'
- '**/set.go'
- 'testdata/gha_workflows/credential_workflow/**'
- '**/test-credential-commands.yml'
pull_request:
paths: # Will trigger on PULL_REQUEST event that update at least one of those files.
- '**/cmd.go'
Expand All @@ -44,110 +45,111 @@ on:
- '**/set_test.go'
- '**/set.go'
- 'testdata/gha_workflows/credential_workflow/**'
- '**/test-credential-commands.yml'

jobs:
ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Create binary from branch
run: |
cd $GITHUB_WORKSPACE
make build-linux && sudo mv ./dist/linux/rit /usr/local/bin
rit init --sendMetrics="no" --addCommons="no" --runType="local"
- name: RIT LIST CREDENTIAL command (1)
run: rit list credential > check1.txt
- uses: GuillaumeFalourd/diff-action@v1
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
first_file_path: check1.txt
second_file_path: testdata/gha_workflows/credential_workflow/assert1.txt
expected_result: PASSED
command_line: rit list credential
assert_file_path: testdata/gha_workflows/credential_workflow/assert1.txt
expected_result: PASSED
- name: RIT SET CREDENTIAL command
run: rit set credential --provider=github --fields=username,email,token --values=test,test,test
- name: RIT LIST CREDENTIAL command (2)
run: rit list credential > check2.txt
- uses: GuillaumeFalourd/diff-action@v1
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
first_file_path: check2.txt
second_file_path: testdata/gha_workflows/credential_workflow/assert2.txt
expected_result: PASSED
command_line: rit list credential
assert_file_path: testdata/gha_workflows/credential_workflow/assert2.txt
expected_result: PASSED
- name: RIT DELETE CREDENTIAL command
run: rit delete credential --provider=github
- name: RIT LIST CREDENTIAL command (3)
run: rit list credential > check3.txt
- uses: GuillaumeFalourd/diff-action@v1
- name: RIT LIST CREDENTIAL command (2)
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
first_file_path: check3.txt
second_file_path: testdata/gha_workflows/credential_workflow/assert1.txt
expected_result: PASSED
command_line: rit list credential
assert_file_path: testdata/gha_workflows/credential_workflow/assert1.txt
expected_result: PASSED

macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Create binary from branch
run: |
cd $GITHUB_WORKSPACE
make build-mac && sudo mv ./dist/darwin/rit /usr/local/bin
rit init --sendMetrics="no" --addCommons="no" --runType="local"
- name: RIT LIST CREDENTIAL command (1)
run: rit list credential > check1.txt
- uses: GuillaumeFalourd/diff-action@v1
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
first_file_path: check1.txt
second_file_path: testdata/gha_workflows/credential_workflow/assert1.txt
expected_result: PASSED
command_line: rit list credential
assert_file_path: testdata/gha_workflows/credential_workflow/assert1.txt
expected_result: PASSED
- name: RIT SET CREDENTIAL command
run: rit set credential --provider=github --fields=username,email,token --values=test,test,test
- name: RIT LIST CREDENTIAL command (2)
run: rit list credential > check2.txt
- uses: GuillaumeFalourd/diff-action@v1
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
first_file_path: check2.txt
second_file_path: testdata/gha_workflows/credential_workflow/assert2.txt
expected_result: PASSED
command_line: rit list credential
assert_file_path: testdata/gha_workflows/credential_workflow/assert2.txt
expected_result: PASSED
- name: RIT DELETE CREDENTIAL command
run: rit delete credential --provider=github
- name: RIT LIST CREDENTIAL command (3)
run: rit list credential > check3.txt
- uses: GuillaumeFalourd/diff-action@v1
- name: RIT LIST CREDENTIAL command (2)
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
first_file_path: check3.txt
second_file_path: testdata/gha_workflows/credential_workflow/assert1.txt
expected_result: PASSED
command_line: rit list credential
assert_file_path: testdata/gha_workflows/credential_workflow/assert1.txt
expected_result: PASSED

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Create binary from branch
run: |
choco install make
make build-windows && move D:\a\ritchie-cli\ritchie-cli\dist\windows\rit.exe "D:\a\ritchie-cli\ritchie-cli"
ls
.\rit.exe init --sendMetrics="no" --addCommons="no" --runType="local"
- name: RIT LIST CREDENTIAL command (1)
run: .\rit.exe list credential > check1.txt
- uses: GuillaumeFalourd/diff-action@v1
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
first_file_path: check1.txt
second_file_path: testdata/gha_workflows/credential_workflow/assert1.txt
expected_result: PASSED
command_line: ./rit.exe list credential
assert_file_path: testdata/gha_workflows/credential_workflow/assert1.txt
expected_result: PASSED
- name: RIT SET CREDENTIAL command
run: .\rit.exe set credential --provider=github --fields=username,email,token --values=test,test,test
run: ./rit.exe set credential --provider=github --fields=username,email,token --values=test,test,test
- name: RIT LIST CREDENTIAL command (2)
run: .\rit.exe list credential > check2.txt
- uses: GuillaumeFalourd/diff-action@v1
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
first_file_path: check2.txt
second_file_path: testdata/gha_workflows/credential_workflow/assert2.txt
expected_result: PASSED
command_line: ./rit.exe list credential
assert_file_path: testdata/gha_workflows/credential_workflow/assert2.txt
expected_result: PASSED
- name: RIT DELETE CREDENTIAL command
run: .\rit.exe delete credential --provider=github
run: ./rit.exe delete credential --provider=github
- name: RIT LIST CREDENTIAL command (3)
run: .\rit.exe list credential > check3.txt
- uses: GuillaumeFalourd/diff-action@v1
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
first_file_path: check3.txt
second_file_path: testdata/gha_workflows/credential_workflow/assert1.txt
expected_result: PASSED
command_line: ./rit.exe list credential
assert_file_path: testdata/gha_workflows/credential_workflow/assert1.txt
expected_result: PASSED
97 changes: 50 additions & 47 deletions .github/workflows/test-env-commands.yml
Expand Up @@ -28,6 +28,8 @@ on:
- '**/show_test.go'
- '**/show.go'
- 'testdata/gha_workflows/env_workflow/**'
- '**/test-env-commands.yml'

pull_request:
paths: # Will trigger on PULL_REQUEST event that update at least one of those files.
- '**/cmd.go'
Expand All @@ -44,110 +46,111 @@ on:
- '**/show_test.go'
- '**/show.go'
- 'testdata/gha_workflows/env_workflow/**'
- '**/test-env-commands.yml'

jobs:
ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Create binary from branch
run: |
cd $GITHUB_WORKSPACE
make build-linux && sudo mv ./dist/linux/rit /usr/local/bin
rit init --sendMetrics="no" --addCommons="no" --runType="local"
- name: RIT SHOW ENV command (1)
run: rit show env > check1.txt
- uses: GuillaumeFalourd/diff-action@v1
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
first_file_path: check1.txt
second_file_path: testdata/gha_workflows/env_workflow/assert1.txt
expected_result: PASSED
command_line: rit show env
assert_file_path: testdata/gha_workflows/env_workflow/assert1.txt
expected_result: PASSED
- name: RIT SET ENV command
run: rit set env --env=test
- name: RIT SHOW ENV command (2)
run: rit show env > check2.txt
- uses: GuillaumeFalourd/diff-action@v1
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
first_file_path: check2.txt
second_file_path: testdata/gha_workflows/env_workflow/assert2.txt
expected_result: PASSED
command_line: rit show env
assert_file_path: testdata/gha_workflows/env_workflow/assert2.txt
expected_result: PASSED
- name: RIT DELETE ENV command
run: rit delete env --env=test
- name: RIT SHOW ENV command (3)
run: rit show env > check3.txt
- uses: GuillaumeFalourd/diff-action@v1
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
first_file_path: check3.txt
second_file_path: testdata/gha_workflows/env_workflow/assert1.txt
expected_result: PASSED
command_line: rit show env
assert_file_path: testdata/gha_workflows/env_workflow/assert1.txt
expected_result: PASSED

macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Create binary from branch
run: |
cd $GITHUB_WORKSPACE
make build-mac && sudo mv ./dist/darwin/rit /usr/local/bin
rit init --sendMetrics="no" --addCommons="no" --runType="local"
- name: RIT SHOW ENV command (1)
run: rit show env > check1.txt
- uses: GuillaumeFalourd/diff-action@v1
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
first_file_path: check1.txt
second_file_path: testdata/gha_workflows/env_workflow/assert1.txt
expected_result: PASSED
command_line: rit show env
assert_file_path: testdata/gha_workflows/env_workflow/assert1.txt
expected_result: PASSED
- name: RIT SET ENV command
run: rit set env --env=test
- name: RIT SHOW ENV command (2)
run: rit show env > check2.txt
- uses: GuillaumeFalourd/diff-action@v1
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
first_file_path: check2.txt
second_file_path: testdata/gha_workflows/env_workflow/assert2.txt
expected_result: PASSED
command_line: rit show env
assert_file_path: testdata/gha_workflows/env_workflow/assert2.txt
expected_result: PASSED
- name: RIT DELETE ENV command
run: rit delete env --env=test
- name: RIT SHOW ENV command (3)
run: rit show env > check3.txt
- uses: GuillaumeFalourd/diff-action@v1
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
first_file_path: check3.txt
second_file_path: testdata/gha_workflows/env_workflow/assert1.txt
expected_result: PASSED
command_line: rit show env
assert_file_path: testdata/gha_workflows/env_workflow/assert1.txt
expected_result: PASSED

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Create binary from branch
run: |
choco install make
make build-windows && move D:\a\ritchie-cli\ritchie-cli\dist\windows\rit.exe "D:\a\ritchie-cli\ritchie-cli"
ls
.\rit.exe init --sendMetrics="no" --addCommons="no" --runType="local"
- name: RIT SHOW ENV command (1)
run: .\rit.exe show env > check1.txt
- uses: GuillaumeFalourd/diff-action@v1
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
first_file_path: check1.txt
second_file_path: testdata/gha_workflows/env_workflow/assert1.txt
expected_result: PASSED
command_line: ./rit.exe show env
assert_file_path: testdata/gha_workflows/env_workflow/assert1.txt
expected_result: PASSED
- name: RIT SET ENV command
run: .\rit.exe set env --env=test
run: ./rit.exe set env --env=test
- name: RIT SHOW ENV command (2)
run: .\rit.exe show env > check2.txt
- uses: GuillaumeFalourd/diff-action@v1
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
first_file_path: check2.txt
second_file_path: testdata/gha_workflows/env_workflow/assert2.txt
expected_result: PASSED
command_line: ./rit.exe show env
assert_file_path: testdata/gha_workflows/env_workflow/assert2.txt
expected_result: PASSED
- name: RIT DELETE ENV command
run: .\rit.exe delete env --env=test
run: ./rit.exe delete env --env=test
- name: RIT SHOW ENV command (3)
run: .\rit.exe show env > check3.txt
- uses: GuillaumeFalourd/diff-action@v1
uses: GuillaumeFalourd/test-cli-commands-action@v1
with:
first_file_path: check3.txt
second_file_path: testdata/gha_workflows/env_workflow/assert1.txt
expected_result: PASSED
command_line: ./rit.exe show env
assert_file_path: testdata/gha_workflows/env_workflow/assert1.txt
expected_result: PASSED

0 comments on commit 5780deb

Please sign in to comment.