View Issue Details

IDProjectCategoryView StatusLast Update
0006000Talermerchant backendpublic2021-08-24 14:23
ReporterChristian Grothoff Assigned Tojonathanbuchanan Resolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PrioritynormalSeveritytweakReproducibilityN/A
Status closedResolutionfixed 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product Versiongit (master) 
Target Version0.8Fixed in Version0.8 
Summary0006000: test case logic is messy
DescriptionFlorian wrote:
I've quoted a *partial* example below,of some multi-screen macro in a
test case. This raises so many questions:

* why does the macro have varargs when they are not used?
* why are there local variables in the macro?
* WTF is this a macro and not a function? it's used only once ...
* why is *everything* defined in a big string? Why don't we have helper
function that take a literal struct that describes the data and then
generates the contract terms? This is such an unreadable,
unmaintainable mess right now.

The old currency format used to look like this, in many places:

  \"pay_deadline\":\"\\/Date(99999999999)\\/\",\

Again raising the questions of:
 * did nobody think that maybe the quoting required here is a bit
excessive and should be somehow factored out? There are dozens of lines
like this.
 * why is there this magic constant, should't "/never/" or { t_ms:
"never" } work instead of some arbitary constant?

Marcello, since I'm super busy with updating some other stuff that's
critical for the congress demo, please update the test cases.

For now, just make sure that it works. But long term, we need to
untangle this mess.

- Florian


#define ALLOCATE_ORDERS(...) \
  char *order_worth_5; \
  char *order_worth_5_track; \
  char *order_worth_5_unaggregated; \
  char *order_worth_10_2coins; \
  \
  GNUNET_asprintf \
    (&order_worth_5, \
    "{\"max_fee\":\
       {\"currency\":\"%s\",\
        \"value\":0,\
        \"fraction\":50000000},\
       \"refund_deadline\": { \"t_ms\": 0 },\
       \"pay_deadline\": { \"t_ms\": 99999999999 },\
       \"amount\":\
         {\"currency\":\"%s\",\
          \"value\":5,\
          \"fraction\":0},\
        \"summary\": \"merchant-lib testcase\",\
        \"fulfillment_url\": \"https://example.com/\",\
        \"products\": [ {\"description\":\"ice cream\",\
                         \"value\":\"{%s:5}\"} ] }", \
    currency, \
    currency, \
    currency); \

[ goes on like this for many more lines ]
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

jonathanbuchanan

2020-07-11 20:52

reporter   ~0016445

The macro seems to have been removed, but we're still passing a json string to TALER_TESTING_cmd_merchant_post_orders, which isn't ideal. I'll change the function to generate this string internally.

jonathanbuchanan

2020-07-12 00:05

reporter   ~0016446

fixed in 89f4530..d545306

Issue History

Date ModifiedUsernameFieldChange
2019-12-20 09:27Christian GrothoffNew Issue
2019-12-20 09:27Christian GrothoffStatusnew => assigned
2019-12-20 09:27Christian GrothoffAssigned To => Marcello Stanisci
2020-03-29 20:08Christian GrothoffTarget Version0.7.1 => 0.8.1
2020-05-01 17:57Christian GrothoffTarget Version0.8.1 => 0.8
2020-07-10 21:28Christian GrothoffAssigned ToMarcello Stanisci => jonathanbuchanan
2020-07-11 20:52jonathanbuchananNote Added: 0016445
2020-07-12 00:05jonathanbuchananNote Added: 0016446
2020-07-12 05:09jonathanbuchananStatusassigned => informing
2020-07-12 05:09jonathanbuchananResolutionopen => fixed
2020-07-24 09:56Christian GrothoffFixed in Version => 0.8
2021-08-24 14:23Christian GrothoffStatusinforming => closed
2025-03-22 13:09Christian GrothoffCategorymechant backend => merchant backend