Skip to content

Commit

Permalink
Merge pull request #139 from jtigger/ignore-all-but-first-test
Browse files Browse the repository at this point in the history
Ignore all but first test in hello-world
  • Loading branch information
matthewmorgan authored Sep 25, 2016
2 parents 78244a2 + 13a7d1b commit 38110bd
Show file tree
Hide file tree
Showing 88 changed files with 1,205 additions and 83 deletions.
7 changes: 7 additions & 0 deletions bin/journey-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ SCRIPTPATH=$( pushd `dirname $0` > /dev/null && pwd && popd > /dev/null )
EXECPATH=$PWD
XAPI_PID=""

# Makes CI output easier to read
TERM=dumb

function on_exit() {
echo ">>> on_exit()"
if [ "$XAPI_PID" != "" ] ; then
Expand Down Expand Up @@ -177,6 +180,7 @@ solve_all_exercises() {
local EXERCISES=`cat config.json | jq '.problems []' --raw-output`
local TOTAL_EXERCISES=`cat config.json | jq '.problems | length'`
local CURRENT_EXERCISE_NUMBER=1
local TEMPFILE="${TMPDIR:-/tmp}/journey-test.sh-unignore_all_tests.txt"

pushd ${EXERCISM_HOME} >/dev/null
for EXERCISE in $EXERCISES; do
Expand All @@ -186,6 +190,9 @@ solve_all_exercises() {
$EXERCISM fetch java $EXERCISE
cp -R -H $REPO_ROOT/exercises/$EXERCISE/src/example/java/* $EXERCISM_HOME/java/$EXERCISE/src/main/java/
pushd $EXERCISM_HOME/java/$EXERCISE/ >/dev/null
for TESTFILE in `find . -name "*Test.java"`; do
sed 's/@Ignore//' $TESTFILE > "$TEMPFILE" && mv "$TEMPFILE" "$TESTFILE"
done
gradle test
popd >/dev/null

Expand Down
5 changes: 4 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,10 @@
"ignored": [
"_template",
".gradle",
"docs"
"build",
"docs",
"gradle",
"scripts"
],
"foregone": [
"leap",
Expand Down
6 changes: 6 additions & 0 deletions exercises/_template/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ repositories {
dependencies {
testCompile "junit:junit:4.10"
}
test {
testLogging {
exceptionFormat = 'full'
events = ["passed", "failed", "skipped"]
}
}
6 changes: 6 additions & 0 deletions exercises/accumulate/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ repositories {
dependencies {
testCompile "junit:junit:4.10"
}
test {
testLogging {
exceptionFormat = 'full'
events = ["passed", "failed", "skipped"]
}
}
6 changes: 6 additions & 0 deletions exercises/accumulate/src/test/java/AccumulateTest.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.junit.Test;
import org.junit.Ignore;

import java.util.Arrays;
import java.util.LinkedList;
Expand All @@ -8,27 +9,31 @@

public class AccumulateTest {


@Test
public void emptyAccumulateProducesEmptyAccumulation() {
List<Integer> input = new LinkedList<>();
List<Integer> expectedOutput = new LinkedList<>();
assertEquals(expectedOutput, Accumulate.accumulate(input, x -> x * x));
}

@Ignore
@Test
public void accumulateSquares() {
List<Integer> input = Arrays.asList(1, 2, 3);
List<Integer> expectedOutput = Arrays.asList(1, 4, 9);
assertEquals(expectedOutput, Accumulate.accumulate(input, x -> x * x));
}

@Ignore
@Test
public void accumulateUpperCases() {
List<String> input = Arrays.asList("hello", "world");
List<String> expectedOutput = Arrays.asList("HELLO", "WORLD");
assertEquals(expectedOutput, Accumulate.accumulate(input, x -> x.toUpperCase()));
}

@Ignore
@Test
public void accumulateReversedStrings() {
List<String> input = Arrays.asList("the quick brown fox etc".split(" "));
Expand All @@ -40,6 +45,7 @@ private String reverse(String input) {
return new StringBuilder(input).reverse().toString();
}

@Ignore
@Test
public void accumulateWithinAccumulate() {
List<String> input1 = Arrays.asList("a", "b", "c");
Expand Down
6 changes: 6 additions & 0 deletions exercises/acronym/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ repositories {
dependencies {
testCompile "junit:junit:4.10"
}
test {
testLogging {
exceptionFormat = 'full'
events = ["passed", "failed", "skipped"]
}
}
8 changes: 8 additions & 0 deletions exercises/acronym/src/test/java/AcronymTest.java
Original file line number Diff line number Diff line change
@@ -1,51 +1,59 @@
import org.junit.Test;
import org.junit.Ignore;

import static org.junit.Assert.assertEquals;

public class AcronymTest {


@Test
public void fromTitleCasedPhrases() {
final String phrase = "Portable Network Graphics";
final String expected = "PNG";
assertEquals(expected, Acronym.generate(phrase));
}

@Ignore
@Test
public void fromOtherTitleCasedPhrases() {
final String phrase = "Ruby on Rails";
final String expected = "ROR";
assertEquals(expected, Acronym.generate(phrase));
}

@Ignore
@Test
public void fromInconsistentlyCasedPhrases() {
final String phrase = "HyperText Markup Language";
final String expected = "HTML";
assertEquals(expected, Acronym.generate(phrase));
}

@Ignore
@Test
public void fromPhrasesWithPunctuation() {
final String phrase = "First In, First Out";
final String expected = "FIFO";
assertEquals(expected, Acronym.generate(phrase));
}

@Ignore
@Test
public void fromOtherPhrasesWithPunctuation() {
final String phrase = "PHP: Hypertext Preprocessor";
final String expected = "PHP";
assertEquals(expected, Acronym.generate(phrase));
}

@Ignore
@Test
public void fromPhrasesWithPunctuationAndSentenceCasing() {
final String phrase = "Complementary metal-oxide semiconductor";
final String expected = "CMOS";
assertEquals(expected, Acronym.generate(phrase));
}

@Ignore
@Test
public void fromPhraseWithSingleLetterWord() {
final String phrase = "Cat in a Hat";
Expand Down
6 changes: 6 additions & 0 deletions exercises/allergies/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ repositories {
dependencies {
testCompile "junit:junit:4.10"
}
test {
testLogging {
exceptionFormat = 'full'
events = ["passed", "failed", "skipped"]
}
}
20 changes: 20 additions & 0 deletions exercises/allergies/src/test/java/AllergiesTest.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.junit.Test;
import org.junit.Ignore;

import java.util.Arrays;
import java.util.List;
Expand All @@ -7,6 +8,7 @@

public class AllergiesTest {


@Test
public void noAllergiesMeansNotAllergicToAnything() {
Allergies allergies = new Allergies(0);
Expand All @@ -17,76 +19,87 @@ public void noAllergiesMeansNotAllergicToAnything() {
assertEquals(false, allergies.isAllergicTo(Allergen.CATS));
}

@Ignore
@Test
public void allergicToEggs() {
Allergies allergies = new Allergies(1);

assertEquals(true, allergies.isAllergicTo(Allergen.EGGS));
}

@Ignore
@Test
public void allergicToPeanuts() {
Allergies allergies = new Allergies(2);

assertEquals(true, allergies.isAllergicTo(Allergen.PEANUTS));
}

@Ignore
@Test
public void allergicToShellfish() {
Allergies allergies = new Allergies(4);

assertEquals(true, allergies.isAllergicTo(Allergen.SHELLFISH));
}

@Ignore
@Test
public void allergicToStrawberries() {
Allergies allergies = new Allergies(8);

assertEquals(true, allergies.isAllergicTo(Allergen.STRAWBERRIES));
}

@Ignore
@Test
public void allergicToTomatoes() {
Allergies allergies = new Allergies(16);

assertEquals(true, allergies.isAllergicTo(Allergen.TOMATOES));
}

@Ignore
@Test
public void allergicToChocolate() {
Allergies allergies = new Allergies(32);

assertEquals(true, allergies.isAllergicTo(Allergen.CHOCOLATE));
}

@Ignore
@Test
public void allergicToPollen() {
Allergies allergies = new Allergies(64);

assertEquals(true, allergies.isAllergicTo(Allergen.POLLEN));
}

@Ignore
@Test
public void allergicToCats() {
Allergies allergies = new Allergies(128);

assertEquals(true, allergies.isAllergicTo(Allergen.CATS));
}

@Ignore
@Test
public void isAllergicToEggsInAdditionToOtherStuff() {
Allergies allergies = new Allergies(5);

assertEquals(true, allergies.isAllergicTo(Allergen.EGGS));
}

@Ignore
@Test
public void noAllergies() {
Allergies allergies = new Allergies(0);

assertEquals(0, allergies.getList().size());
}

@Ignore
@Test
public void isAllergicToJustEggs() {
Allergies allergies = new Allergies(1);
Expand All @@ -95,6 +108,7 @@ public void isAllergicToJustEggs() {
assertEquals(expectedAllergens, allergies.getList());
}

@Ignore
@Test
public void isAllergicToJustPeanuts() {
Allergies allergies = new Allergies(2);
Expand All @@ -103,6 +117,7 @@ public void isAllergicToJustPeanuts() {
assertEquals(expectedAllergens, allergies.getList());
}

@Ignore
@Test
public void isAllergicToJustStrawberries() {
Allergies allergies = new Allergies(8);
Expand All @@ -111,6 +126,7 @@ public void isAllergicToJustStrawberries() {
assertEquals(expectedAllergens, allergies.getList());
}

@Ignore
@Test
public void isAllergicToEggsAndPeanuts() {
Allergies allergies = new Allergies(3);
Expand All @@ -122,6 +138,7 @@ public void isAllergicToEggsAndPeanuts() {
assertEquals(expectedAllergens, allergies.getList());
}

@Ignore
@Test
public void isAllergicToEggsAndShellfish() {
Allergies allergies = new Allergies(5);
Expand All @@ -133,6 +150,7 @@ public void isAllergicToEggsAndShellfish() {
assertEquals(expectedAllergens, allergies.getList());
}

@Ignore
@Test
public void isAllergicToLotsOfStuff() {
Allergies allergies = new Allergies(248);
Expand All @@ -147,6 +165,7 @@ public void isAllergicToLotsOfStuff() {
assertEquals(expectedAllergens, allergies.getList());
}

@Ignore
@Test
public void isAllergicToEverything() {
Allergies allergies = new Allergies(255);
Expand All @@ -164,6 +183,7 @@ public void isAllergicToEverything() {
assertEquals(expectedAllergens, allergies.getList());
}

@Ignore
@Test
public void ignoreNonAllergenScoreParts() {
Allergies allergies = new Allergies(509);
Expand Down
6 changes: 6 additions & 0 deletions exercises/anagram/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ dependencies {
testCompile "junit:junit:4.10"
testCompile "org.assertj:assertj-core:3.2.0"
}
test {
testLogging {
exceptionFormat = 'full'
events = ["passed", "failed", "skipped"]
}
}
Loading

0 comments on commit 38110bd

Please sign in to comment.