Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
69d0d04
Run test for only changed exercises
jagdish-15 Sep 5, 2025
fb25777
Make test-changed-exercise executable
jagdish-15 Sep 5, 2025
29a74a6
Minor change
jagdish-15 Sep 5, 2025
10670d5
More changes
jagdish-15 Sep 5, 2025
07cbf54
typo
jagdish-15 Sep 5, 2025
fcec36e
typo
jagdish-15 Sep 5, 2025
179c523
Update AffineCipher.java
jagdish-15 Sep 5, 2025
62505d5
Update BaseConverterTest.java
jagdish-15 Sep 5, 2025
aaa81fa
Update AffineCipherTest.java
jagdish-15 Sep 5, 2025
ff2e6bf
Update AllergiesTest.java
jagdish-15 Sep 5, 2025
7c51f38
Update config.json
jagdish-15 Sep 5, 2025
4b705fc
Update BaseConverterTest.java
jagdish-15 Sep 5, 2025
c87c8d8
Update config.json
jagdish-15 Sep 5, 2025
e16a25c
Update BirdWatcherTest.java
jagdish-15 Sep 5, 2025
bfa91be
Update BirdWatcherTest.java
jagdish-15 Sep 5, 2025
663b7e6
Update BirdWatcherTest.java
jagdish-15 Sep 5, 2025
5bee761
Update BirdWatcherTest.java
jagdish-15 Sep 5, 2025
d7bb6fb
Update AffineCipher.java
jagdish-15 Sep 5, 2025
93577e9
Update AffineCipher.java
jagdish-15 Sep 5, 2025
4f4fd81
Update AffineCipherTest.java
jagdish-15 Sep 5, 2025
4adeb72
Update test-changed-exercise
jagdish-15 Sep 7, 2025
c0d044a
Update AffineCipherTest.java
jagdish-15 Sep 7, 2025
0d14dde
Merge branch 'main' into jagdish-15-patch-2
jagdish-15 Sep 7, 2025
ef50c87
Update build.gradle
jagdish-15 Sep 7, 2025
7ac9e8b
Update build.gradle
jagdish-15 Sep 15, 2025
70ab8ee
Update build.gradle
jagdish-15 Sep 15, 2025
f6e0b03
Merge branch 'main' into jagdish-15-patch-2
jagdish-15 Sep 15, 2025
e27d43b
Update settings.gradle
jagdish-15 Sep 15, 2025
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
18 changes: 5 additions & 13 deletions bin/test-changed-exercise
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
#!/usr/bin/env bash
set -eo pipefail

# Determine the base branch of the PR
BASE_BRANCH=${GITHUB_BASE_REF:-main}

# Fetch full history for proper diff
git fetch origin "$BASE_BRANCH"
MERGE_BASE=$(git merge-base HEAD origin/$BASE_BRANCH)

# Compute merge base
MERGE_BASE=$(git merge-base HEAD origin/"$BASE_BRANCH")

# Get changed files relative to merge base
changed_files=$(git diff --name-only "$MERGE_BASE" HEAD)

# If any Gradle build file changed, run the full suite and exit
if echo "$changed_files" | grep -qE '\.(gradle|gradlew|bat)$|settings\.gradle'; then
# If any gradle file changed, run the global script
if echo "$changed_files" | grep -q '\.gradle$'; then
echo "Gradle build files changed, running full test suite..."
./bin/test-with-test-runner
./exercises/gradlew -p exercises test
exit 0
fi

# Extract unique exercise directories
# Otherwise, run tests only for changed exercises
changed_exercises=$(echo "$changed_files" | \
grep -E '^exercises/(practice|concept)/[^/]+/.+\.java$' | \
cut -d/ -f1-3 | sort -u)
Expand All @@ -30,12 +24,10 @@ if [ -z "$changed_exercises" ]; then
exit 0
fi

# Print exercises
echo "Changed exercises detected:"
echo "$changed_exercises"
echo "----------------------------------------"

# Run tests
for dir in $changed_exercises; do
slug=$(basename "$dir")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

import static org.assertj.core.api.Assertions.*;




public class BirdWatcherTest {

private static final int DAY1 = 0;
Expand Down Expand Up @@ -46,6 +49,10 @@ public void itIncrementTodaysCount() {
assertThat(birdWatcher.getToday()).isEqualTo(TODAY + 1);
}





@Test
@Tag("task:4")
@DisplayName("The hasDayWithoutBirds method returns true when day had no visits")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import java.util.ArrayList;
import java.util.List;





class AffineCipher {
private static final int GROUP_SIZE = 5;
private static final int ALPHABET_SIZE = 26;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ public class AffineCipherTest {

private AffineCipher affineCipher = new AffineCipher();





@Test
@DisplayName("encode yes")
public void testEncodeYes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

public class BaseConverterTest {





@Test
@DisplayName("single bit one to decimal")
public void testSingleBitOneToDecimal() {
Expand Down
5 changes: 5 additions & 0 deletions exercises/practice/allergies/src/test/java/AllergiesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ public class AllergiesTest {

// Testing for eggs allergy






@Test
@DisplayName("not allergic to anything")
public void eggsNotAllergicToAnything() {
Expand Down
4 changes: 4 additions & 0 deletions exercises/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ include 'concept:bird-watcher'
// include 'concept:blackjack' // deprecated
include 'concept:booking-up-for-beauty'
include 'concept:calculator-conundrum'




include 'concept:captains-log'
include 'concept:cars-assemble'
include 'concept:jedliks-toy-car'
Expand Down