From fff0d4a2652ce7709a6e9100b5ed756ff7c43172 Mon Sep 17 00:00:00 2001 From: Jeff Flater Date: Mon, 21 Jul 2025 11:27:21 -0500 Subject: [PATCH 1/2] add welcome test --- .vscode/tasks.json | 9 +++++++++ test/features/steps/welcome_steps.py | 17 +++++++++++++++++ test/features/welcome.feature | 7 +++++++ 3 files changed, 33 insertions(+) create mode 100644 test/features/steps/welcome_steps.py create mode 100644 test/features/welcome.feature 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 From 282588293812e9eda55eb0d00dc5672981a76d1f Mon Sep 17 00:00:00 2001 From: Jeff Flater Date: Mon, 21 Jul 2025 11:29:28 -0500 Subject: [PATCH 2/2] rm pr enforcement --- .github/workflows/enforce-develop-pr.yml | 36 ++++++++++++------------ .github/workflows/enforce-staging-pr.yml | 36 ++++++++++++------------ 2 files changed, 36 insertions(+), 36 deletions(-) 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