Skip to content
Draft
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM crystallang/crystal:1.15.1-alpine
FROM crystallang/crystal:1.18.2-alpine

# install packages required to run the tests
RUN apk add --no-cache bash jq coreutils
Expand Down
5 changes: 5 additions & 0 deletions bin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ echo "${slug}: testing..."

# Run the tests for the provided implementation file and redirect stdout and
# stderr to capture it

if [ "${slug}" = "parallel-letter-frequency" ]; then
crystal spec "${modified_spec_file}" --junit_output="${output_dir}" --tag "~optional" -Dpreview_mt --no-color &> "${capture_file}"
else
crystal spec "${modified_spec_file}" --junit_output="${output_dir}" --tag "~optional" --no-color &> "${capture_file}"
fi

./bin/test_runner "${spec_file}" "${capture_file}" "${junit_file}" "${results_file}"

Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 2.1.3

- Move to Crystal 1.19.x
- Add support for parallel testing

# 2.1.2

- Move to Crystal 1.15.1
Expand Down
2 changes: 1 addition & 1 deletion helpers/setup_test_file.cr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def fix_test_file(spec_input, spec_output)
spec_file = File.read(spec_input).split("\n")
index = spec_file.index {|x| x.includes?("describe")}
unless index.nil?
spec_file = spec_file.insert(index + 1, "around_each do |example|\noriginal_stdout = File.open(\"/dev/null\")\noriginal_stdout.reopen(STDOUT)\nIO.pipe do |reader, writer|\nSTDOUT.reopen(writer)\nbegin\nexample.run\nensure\nwriter.close\nSTDOUT.reopen(original_stdout)\nend\nadd = File.exists?(\"/tmp/output.json\") ? JSON.parse(File.read(\"/tmp/output.json\")).to_s[1..-2] + \", \" : \"\"\nFile.write(\"/tmp/output.json\", JSON.parse(\"[\" + add + \"\#{reader.gets_to_end.split(\"\n\")[..-2].join(\"\n\").inspect}]\"))\nend\nend\n")
spec_file = spec_file.insert(index + 1, "around_each do |example|\noriginal_stdout = File.open(\"/dev/null\")\noriginal_stdout.reopen(STDOUT)\nIO.pipe do |reader, writer|\nSTDOUT.reopen(writer)\nbegin\nexample.run\nensure\nwriter.close\nSTDOUT.reopen(original_stdout)\nend\nadd = File.exists?(\"/tmp/output.json\") ? File.read(\"/tmp/output.json\").to_s[1..-2] + \", \" : \"\"\nFile.write(\"/tmp/output.json\", \"[\" + add + \"\#{reader.gets_to_end.split(\"\n\")[..-2].join(\"\n\").inspect}]\")\nend\nend\n")
end
unless spec_output.nil?
File.write(spec_output, "require \"json\"\n" + spec_file.join("\n").gsub("pending", "it"))
Expand Down