Skip to content

Commit

Permalink
FIX: return status bug, add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gregberns committed Oct 18, 2020
1 parent 1a0e33a commit 2276667
Show file tree
Hide file tree
Showing 14 changed files with 98 additions and 1,318 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
target
target
bin
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
bin
test/actual
test/output

/target
/test_input
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM clux/muslrust as build
FROM clux/muslrust:nightly-2020-10-17 as build

WORKDIR /build
COPY Cargo.toml Cargo.lock /build/
Expand Down Expand Up @@ -29,7 +29,7 @@ RUN mkdir /fcheck/config &&\
mkdir /fcheck/data &&\
mkdir /fcheck/output

COPY --from=build /build/target/x86_64-unknown-linux-musl/release/fcheck /app
COPY --from=build /build/target/x86_64-unknown-linux-musl/release/fcheck /bin

CMD ["./fcheck"]

Expand All @@ -51,6 +51,6 @@ RUN mkdir /fcheck/config &&\
mkdir /fcheck/data &&\
mkdir /fcheck/output

COPY --from=build /build/target/x86_64-unknown-linux-musl/release/fcheck /app
COPY --from=build /build/target/x86_64-unknown-linux-musl/release/fcheck /bin

CMD ["./fcheck"]
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,16 @@ To run in docker:
docker run -v ${PWD}/config/:/fcheck/config/ -v ${PWD}/data/:/fcheck/data/ fcheck -c ./examples/config.toml -r ./data/report.json
```

### Rust
### High Priority Tasks

```bash
cargo build
cargo run -- -c ./config/config-v3.toml
```
* Bug: fcheck returning exit code 0, event though tests have failed

### Other Tasks

* Add support for other shells: bash, zsh. This will allow support in Alpine.
* Handle all warnings, code cleanup
* Add version to binary based on VERSION file
* Make output report readable
* Add examples
* Compile to different docker container bases
* Add Dhall support
8 changes: 4 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ echo "Start Build"
docker build --target alpine -t $TAG . || exit $?
echo "End Build"

source_path=/app
destination_path=./bin/$VERSION/fcheck
source_path=/bin/fcheck
destination_dir=./bin/$VERSION

mkdir -p $destination_path
mkdir -p $destination_dir

container_id=$(docker create $TAG)
docker cp $container_id:$source_path $destination_path
docker cp $container_id:$source_path $destination_dir
docker rm $container_id
22 changes: 22 additions & 0 deletions examples/simple-http/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM debian:stretch as debian-stretch

WORKDIR /fcheck

RUN wget https://github.com/gregberns/fcheck/releases/download/0.3.0/fcheck

# Install any needed libraries
# * `wdiff` has been quite useful for checking text files
# * `netcat` ensures a service's port is open before fcheck starts tests
RUN apt-get update &&\
apt-get install -y --no-install-recommends wdiff netcat &&\
apt-get clean && rm -rf /var/lib/apt/lists/*

# Config is for the `fcheck-config.toml` file
RUN mkdir /fcheck/config &&\
# The data directory is used for `actual` and `expected` folders to diff test results
mkdir /fcheck/data &&\
# The output directory can be used for the output report
mkdir /fcheck/output

# For local testing, its helpful to just mount the `fcheck-config.toml`, then the container isn't rebuilt every time
CMD ["/bin/fcheck", "--config-file", "/fcheck/config/fcheck-config.toml", "--report-file", "/output/report.json"]
Loading

0 comments on commit 2276667

Please sign in to comment.