Skip to content
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

Test if CI push triggers subsequent CI job #96

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
4 changes: 2 additions & 2 deletions .github/workflows/fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.RYAN_FIXTURE_GEN_PAT }}
token: ${{ secrets.TESTER_FIXTURE_GENERATION_GITHUB_TOKEN }}

- name: Set up Go
uses: actions/setup-go@v1
Expand All @@ -43,7 +43,7 @@ jobs:
run: |
git config --global user.email "[email protected]"
git config --global user.name "Ryan Gang"
git remote set-url origin https://ryan-gang:${{ secrets.RYAN_FIXTURE_GEN_PAT }}@github.com/codecrafters-io/shell-tester.git
git remote set-url origin https://ryan-gang:${{ secrets.TESTER_FIXTURE_GENERATION_GITHUB_TOKEN }}@github.com/codecrafters-io/shell-tester.git
git fetch origin ${{ github.head_ref }}
git checkout ${{ github.head_ref }}
git diff --quiet || (git add . && git commit -m "ci: add regenerated fixtures" && git push)
2 changes: 1 addition & 1 deletion internal/stage2.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func testInvalidCommand(stageHarness *test_case_harness.TestCaseHarness) error {
}

testCase := test_cases.InvalidCommandTestCase{
Command: getRandomInvalidCommand(),
Command: "invalid",
}
if err := testCase.RunWithoutNextPromptAssertion(asserter, shell, logger); err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions internal/test_helpers/fixtures/base/pass
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ Debug = true

[stage-2] Running tests for Stage #2: cz2
[stage-2] Running ./your_shell.sh
[your-program] $ invalid_blueberry_command
[your-program] bash: invalid_blueberry_command: command not found
[your-program] $ invalid
[your-program] bash: invalid: command not found
[stage-2] ✓ Received command not found message
[your-program] $
[stage-2] Test passed.
Expand Down
4 changes: 2 additions & 2 deletions internal/test_helpers/fixtures/escape_codes
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Debug = true

[stage-2] Running tests for Stage #2: cz2
[stage-2] Running ./your_shell.sh
[your-program] $ invalid_pear_command
[your-program] invalid_pear_command: command not found
[your-program] $ invalid
[your-program] invalid: command not found
[stage-2] ✓ Received command not found message
[your-program] $
[stage-2] Test passed.
Expand Down
6 changes: 3 additions & 3 deletions internal/test_helpers/fixtures/navigation/pass
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Debug = true
[your-program] pwd is a shell builtin
[stage-9] ✓ Received expected response
[your-program] $ pwd
[your-program] /workspaces/shell-tester/internal
[your-program] /home/runner/work/shell-tester/shell-tester/internal
[stage-9] ✓ Received current working directory response
[your-program] $
[stage-9] Test passed.
Expand Down Expand Up @@ -148,8 +148,8 @@ Debug = true

[stage-2] Running tests for Stage #2: cz2
[stage-2] Running ./your_shell.sh
[your-program] $ invalid_strawberry_command
[your-program] bash: invalid_strawberry_command: command not found
[your-program] $ invalid
[your-program] bash: invalid: command not found
[stage-2] ✓ Received command not found message
[your-program] $
[stage-2] Test passed.
Expand Down
4 changes: 2 additions & 2 deletions internal/test_helpers/fixtures/no_output
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Debug = true

[stage-2] Running tests for Stage #2: cz2
[stage-2] Running ./your_shell.sh
[your-program] $ invalid_pear_command
[your-program] $ invalid
[stage-2] Output does not match expected value.
[stage-2] Expected: "invalid_pear_command: command not found"
[stage-2] Expected: "invalid: command not found"
[stage-2] Received: ""
[stage-2] Assertion failed.
[stage-2] Test failed
8 changes: 4 additions & 4 deletions internal/test_helpers/fixtures/wrong_output
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ Debug = true

[stage-2] Running tests for Stage #2: cz2
[stage-2] Running ./your_shell.sh
[your-program] $ invalid_pear_command
[your-program] Command: invalid_pear_command
[your-program] $ invalid
[your-program] Command: invalid
[stage-2] Output does not match expected value.
[stage-2] Expected: "invalid_pear_command: command not found"
[stage-2] Received: "Command: invalid_pear_command"
[stage-2] Expected: "invalid: command not found"
[stage-2] Received: "Command: invalid"
[stage-2] Assertion failed.
[stage-2] Test failed
Loading