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
36 changes: 18 additions & 18 deletions .github/workflows/enforce-develop-pr.yml
Original file line number Diff line number Diff line change
@@ -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
36 changes: 18 additions & 18 deletions .github/workflows/enforce-staging-pr.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
17 changes: 17 additions & 0 deletions test/features/steps/welcome_steps.py
Original file line number Diff line number Diff line change
@@ -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")
7 changes: 7 additions & 0 deletions test/features/welcome.feature
Original file line number Diff line number Diff line change
@@ -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