Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PaymentServer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Administrator
PaymentServer
Commits
4cf7ea6f
Commit
4cf7ea6f
authored
5 years ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Patches
Plain Diff
[wip]
parent
a1ffa72c
No related branches found
No related tags found
1 merge request
!22
Ristretto-flavored PrivacyPass
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.circleci/config.yml
+5
-0
5 additions, 0 deletions
.circleci/config.yml
PaymentServer.cabal
+1
-0
1 addition, 0 deletions
PaymentServer.cabal
test/SpecRedemption.hs
+50
-0
50 additions, 0 deletions
test/SpecRedemption.hs
with
56 additions
and
0 deletions
.circleci/config.yml
+
5
−
0
View file @
4cf7ea6f
...
@@ -84,6 +84,10 @@ jobs:
...
@@ -84,6 +84,10 @@ jobs:
# --no-terminal avoids having fancy progress reports written to
# --no-terminal avoids having fancy progress reports written to
# stdout.
# stdout.
#
#
# --interleaved-output dumps realtime output on build progress.
# This may help avoid timeouts when building large packages (eg
# stripe-core).
#
# --fast turns off compiler optimizations which probably doesn't
# --fast turns off compiler optimizations which probably doesn't
# make a lot of difference in our code but it can speed up build
# make a lot of difference in our code but it can speed up build
# times for our dependencies (as well as reduce compiler memory
# times for our dependencies (as well as reduce compiler memory
...
@@ -99,6 +103,7 @@ jobs:
...
@@ -99,6 +103,7 @@ jobs:
# --no-haddock-deps skips building docs for all our dependencies.
# --no-haddock-deps skips building docs for all our dependencies.
BUILD="stack build \
BUILD="stack build \
--no-terminal \
--no-terminal \
--interleaved-output \
--fast \
--fast \
--test \
--test \
--coverage \
--coverage \
...
...
This diff is collapsed.
Click to expand it.
PaymentServer.cabal
+
1
−
0
View file @
4cf7ea6f
...
@@ -78,6 +78,7 @@ test-suite PaymentServer-test
...
@@ -78,6 +78,7 @@ test-suite PaymentServer-test
, tasty-discover
, tasty-discover
, tasty-quickcheck
, tasty-quickcheck
, tasty-hspec
, tasty-hspec
, tasty-hunit
, tasty-wai
, tasty-wai
, servant-server
, servant-server
, containers
, containers
...
...
This diff is collapsed.
Click to expand it.
test/SpecRedemption.hs
+
50
−
0
View file @
4cf7ea6f
...
@@ -20,6 +20,36 @@ import Servant
...
@@ -20,6 +20,36 @@ import Servant
,
Proxy
(
Proxy
)
,
Proxy
(
Proxy
)
,
serve
,
serve
)
)
import
Test.Tasty.Providers
(
TestName
,
singleTest
)
import
Test.Tasty
(
TestTree
,
testGroup
,
withResource
)
import
Test.Tasty.HUnit
(
Assertion
,
testCase
)
import
Test.Tasty.Wai
(
testWai
,
assertStatus'
,
assertBody
,
assertHeader
,
get
)
import
Test.Tasty.QuickCheck
(
testProperty
)
import
Network.HTTP.Types
(
status200
,
status405
)
import
Test.Hspec
import
Test.Hspec
(
Spec
(
Spec
,
parallel
,
parallel
...
@@ -184,3 +214,23 @@ matchJSONBody expected =
...
@@ -184,3 +214,23 @@ matchJSONBody expected =
Just
$
"decoded body does not equal expected value: "
++
show
actual
++
show
expected
Just
$
"decoded body does not equal expected value: "
++
show
actual
++
show
expected
in
in
MatchBody
bodyMatcher
MatchBody
bodyMatcher
-- testWithDatabase :: VoucherDatabase d => d -> Assertion
-- testWithDatabase database =
-- let
-- testApp = app trivialIssue database
-- in
-- test_redemption :: TestTree
-- test_redemption =
-- let
-- testApp = memory >>= (return . app trivialIssue)
-- in
-- withResource testApp (\x -> return ()) $ \getApp ->
-- testGroup "Voucher Redemption"
-- [ testWai' getApp "a non-POST receives a 405 (Method Not Allowed) response" $
-- do
-- res <- get "/"
-- assertStatus' status405 res
-- assertBody "blub" res
-- ]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment