-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Representer Updates and Golden Tests (#45)
* Add practice exericse golden files. * Add concept exercise golden files. * Add example test golden files. * Created run in docker script to build docker container and run golden tests. * Added CI workflow to test with golden files. * Changed Dockerfile to use Alpine and updated run scripts and requirements. * Removed astor lib and replaced it with Python 3.11 AST Lib Changed representation.txt to be a non-indented AST string Changed representation.out to have AST converted to code Added Normalizers for print removal, __main__ removal, and generator support * Added metadata property, and adjusted script to output metadata.json. * Added golden tests for concept, practice, and example exercises. * Small adjustments. * Removed unneeded example.py files. * Re-ran golden files for practice exercises. * Re-ran golden files for concept exercises. * Re-ran golden files for example tests. * Pinned Ubuntu version to 22.04 * Removed curl, bash, and apk updates from dockerfile. * Added cache clean, but thought better of it. * Moved normalized code to first position in representer.out file. * changed job name to test from build.
- Loading branch information
Showing
1,033 changed files
with
298,434 additions
and
496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,7 @@ | |
.gitattributes | ||
.dockerignore | ||
Dockerfile | ||
test/ | ||
bin/ | ||
!bin/run.py | ||
!bin/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env sh | ||
|
||
# Synopsis: | ||
# Test the test runner Docker image by running it against a predefined set of | ||
# solutions with an expected output. | ||
# The test runner Docker image is built automatically. | ||
|
||
# Output: | ||
# Outputs the diff of the expected test results against the actual test results | ||
# generated by the test runner Docker image. | ||
|
||
# Example: | ||
# ./bin/run-tests-in-docker.sh | ||
|
||
# Stop executing when a command returns a non-zero return code | ||
set -e | ||
|
||
# Build the Docker image | ||
docker build --rm -t exercism/python-representer . | ||
|
||
# Run the Docker image using the settings mimicking the production environment | ||
docker run \ | ||
--rm \ | ||
--network none \ | ||
--read-only \ | ||
--mount type=bind,src="${PWD}/test",dst=/opt/representer/test \ | ||
--mount type=tmpfs,dst=/tmp \ | ||
--workdir /opt/representer \ | ||
--entrypoint pytest \ | ||
exercism/python-representer -v --disable-warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#! /bin/sh | ||
#! /usr/bin/env sh | ||
|
||
root="$( dirname "$( cd "$( dirname "$0" )" >/dev/null 2>&1 && pwd )" )" | ||
export PYTHONPATH="$root:$PYTHONPATH" | ||
python bin/run.py "$@" | ||
/usr/bin/env python3 bin/run.py "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.