diff --git a/.github/workflows/enforce-develop-pr.yml b/.github/workflows/enforce-develop-pr.yml index 2acc99f..c8ed216 100644 --- a/.github/workflows/enforce-develop-pr.yml +++ b/.github/workflows/enforce-develop-pr.yml @@ -1,20 +1,20 @@ -name: Enforce PRs Only from Develop +# name: Enforce PRs Only from Develop -on: - pull_request: - branches: [staging] - types: [opened, synchronize, reopened] +# on: +# pull_request: +# branches: [staging] +# types: [opened, synchronize, reopened] -jobs: - check-develop-only: - runs-on: ubuntu-latest - steps: - - name: Fail if source is not develop - run: | - echo "Source branch: ${{ github.head_ref }}" - if [[ "${{ github.head_ref }}" != "develop" ]]; then - echo "❌ Only PRs from 'develop' branch are allowed to merge into 'staging'." - exit 1 - else - echo "✅ PR is from develop branch. Proceeding." - fi +# jobs: +# check-develop-only: +# runs-on: ubuntu-latest +# steps: +# - name: Fail if source is not develop +# run: | +# echo "Source branch: ${{ github.head_ref }}" +# if [[ "${{ github.head_ref }}" != "develop" ]]; then +# echo "❌ Only PRs from 'develop' branch are allowed to merge into 'staging'." +# exit 1 +# else +# echo "✅ PR is from develop branch. Proceeding." +# fi diff --git a/.github/workflows/enforce-staging-pr.yml b/.github/workflows/enforce-staging-pr.yml index 16eb376..247c9ad 100644 --- a/.github/workflows/enforce-staging-pr.yml +++ b/.github/workflows/enforce-staging-pr.yml @@ -1,20 +1,20 @@ -name: Enforce PRs Only from Staging +# name: Enforce PRs Only from Staging -on: - pull_request: - branches: [main] - types: [opened, synchronize, reopened] +# on: +# pull_request: +# branches: [main] +# types: [opened, synchronize, reopened] -jobs: - check-branch: - runs-on: ubuntu-latest - steps: - - name: Fail if source is not staging - run: | - echo "Source branch: ${{ github.head_ref }}" - if [[ "${{ github.head_ref }}" != "staging" ]]; then - echo "❌ Only PRs from 'staging' are allowed to merge into 'main'." - exit 1 - else - echo "✅ PR is from staging branch. Proceeding." - fi +# jobs: +# check-branch: +# runs-on: ubuntu-latest +# steps: +# - name: Fail if source is not staging +# run: | +# echo "Source branch: ${{ github.head_ref }}" +# if [[ "${{ github.head_ref }}" != "staging" ]]; then +# echo "❌ Only PRs from 'staging' are allowed to merge into 'main'." +# exit 1 +# else +# echo "✅ PR is from staging branch. Proceeding." +# fi diff --git a/.vscode/tasks.json b/.vscode/tasks.json index db7cf40..fa0526f 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -12,6 +12,15 @@ }, "detail": "Builds the Docker image for Behave tests" }, + { + "label": "Docker: Run Welcome from TestJeff", + "type": "shell", + "command": "docker run --rm --env-file .env -v ${workspaceFolder}/reports:/app/reports behave-test test/features/welcome.feature --junit --junit-directory /app/reports", + "dependsOn": ["Docker: Build Behave Image"], + "problemMatcher": [], + "group": "test", + "detail": "Runs only the welcome.feature test to verify setup from TestJeff" + }, { "label": "Docker: Run All Behave Tests", "type": "shell", diff --git a/test/features/steps/welcome_steps.py b/test/features/steps/welcome_steps.py new file mode 100644 index 0000000..3bca5ec --- /dev/null +++ b/test/features/steps/welcome_steps.py @@ -0,0 +1,17 @@ +from behave import given, when, then + +@given("the course has started") +def step_impl_given(context): + print("\n[INFO] Course is now in session...") + +@when("the student runs the first test") +def step_impl_when(context): + print("[ACTION] Student is running the welcome test...") + +@then("TestJeff welcomes the student") +def step_impl_then(context): + print("\n🎉 Welcome to the course! – From TestJeff 🎉") + +@then("confirms the setup is working") +def step_impl_then_setup(context): + print("✅ Your setup is now working correctly.\n") diff --git a/test/features/welcome.feature b/test/features/welcome.feature new file mode 100644 index 0000000..be04372 --- /dev/null +++ b/test/features/welcome.feature @@ -0,0 +1,7 @@ +Feature: Welcome Message + + Scenario: Student runs the welcome test + Given the course has started + When the student runs the first test + Then TestJeff welcomes the student + And confirms the setup is working