Skip to content

Commit

Permalink
Fix tests (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
joecorall authored Nov 9, 2023
1 parent c3127d3 commit 1e4d2f4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
fixtures/
config/
Dockerfile
.gitignore
.dockerignore
.goreleaser.yml
README.md
.github
.git
15 changes: 8 additions & 7 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ jobs:
tags: |
ezproxy-url-checker:${{steps.extract_branch.outputs.branch}}
- name: Start service
shell: bash
run: |-
cp fixtures/*.txt config/
docker run --rm -d -p 8888:8888 ezproxy-url-checker:${{steps.extract_branch.outputs.branch}}
- name: Run tests
shell: bash
run: |-
./scripts/test.sh
CONTAINER=$(docker run \
--rm \
-d \
-v $(pwd)/fixtures:/app/config \
ezproxy-url-checker:${{steps.extract_branch.outputs.branch}})
docker logs $CONTAINER
docker exec $CONTAINER /bin/bash /app/scripts/test.sh
docker stop $CONTAINER
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
linters:
enable:
- gofmt
2 changes: 1 addition & 1 deletion fixtures/domains.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lehigh.edu
lib.lehigh.edu
6 changes: 4 additions & 2 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ echo "Checking domains in config return 200s"
URLS=(
"https://lts.lehigh.edu"
"https://preserve.lehigh.edu"
"https://$RANDOM.lehigh.edu"
"https://$RANDOM.$RANDOM.lehigh.edu"
"https://$RANDOM.lib.lehigh.edu"
"https://$RANDOM.$RANDOM.lib.lehigh.edu"

)
for URL in "${URLS[@]}"; do
Expand All @@ -27,6 +27,8 @@ done
echo "Checking domains not in config throw 404s"
URLS=(
"https://scholar.google.com"
"https://$RANDOM.lehigh.edu"
"https://$RANDOM.$RANDOM.lehigh.edu"
)
for URL in "${URLS[@]}"; do
echo "Checking $URL"
Expand Down

0 comments on commit 1e4d2f4

Please sign in to comment.