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
32 changes: 32 additions & 0 deletions .github/workflows/sync-setup-script.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Sync Setup Script to GitHub Pages

on:
push:
branches:
- main
paths:
- 'setup.sh'
workflow_dispatch:

jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout kagglelink repo
uses: actions/checkout@v4

- name: Create setup file (without .sh extension)
run: cp setup.sh setup

- name: Push setup to GitHub Pages repo
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.PAGES_DEPLOY_TOKEN }}
with:
source_file: 'setup'
destination_repo: 'bhdai/bhdai.github.io'
destination_folder: ''
destination_branch: 'master'
user_email: 'github-actions[bot]@users.noreply.github.com'
user_name: 'github-actions[bot]'
commit_message: 'Sync setup script from kagglelink repo'
40 changes: 40 additions & 0 deletions tests/unit/test_argument_parsing.bats
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,46 @@ teardown() {
[[ "$output" == *"Usage"* ]] || [[ "$output" == *"-k"* ]] || [[ "$output" == *"help"* ]]
}

# =============================================================================
# Exit Code Tests (AC1, AC3)
# =============================================================================

@test "P0: help flag (-h) should exit with code 0" {
run bash setup.sh -h
[ "$status" -eq 0 ]
[[ "$output" == *"Usage"* ]]
}

@test "P0: help flag (--help) should exit with code 0" {
run bash setup.sh --help
[ "$status" -eq 0 ]
[[ "$output" == *"Usage"* ]]
}

@test "P0: unknown option should exit with code 1" {
run bash setup.sh --invalid-flag
[ "$status" -eq 1 ]
[[ "$output" == *"Unknown option"* ]]
}

@test "P0: missing required arguments should exit with code 1" {
run bash setup.sh -k "https://example.com/keys"
[ "$status" -eq 1 ]
}

@test "P0: unknown option should display specific error message" {
run bash setup.sh -x value
[ "$status" -eq 1 ]
[[ "$output" == *"Unknown option: -x"* ]]
}

@test "P1: usage message should include branch variable" {
run bash setup.sh -h
[ "$status" -eq 0 ]
# Should show branch in usage (via KAGGLELINK_BRANCH variable)
[[ "$output" == *"BRANCH"* ]] || [[ "$output" == *"main"* ]]
}

# =============================================================================
# URL Validation Tests (Future - when URL validation is implemented)
# =============================================================================
Expand Down