Skip to content

Commit ea4e906

Browse files
committed
restore version upgrade test
1 parent e7f7110 commit ea4e906

File tree

13 files changed

+26
-24
lines changed

13 files changed

+26
-24
lines changed

.github/workflows/antithesis_daily.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ jobs:
2525
OPERATOR_TAG: "v2.10.1"
2626
OPERATOR_UTILS_TAG: "v2.0.14"
2727
GATEWAY_TAG: "v2.0.24"
28-
# LEDGER_PREVIOUS_TAG: "v2.2.47"
29-
# temporary: remove this when support for multiple image versions is added
30-
LEDGER_PREVIOUS_TAG: "v2.3.0"
28+
LEDGER_PREVIOUS_TAG: "v2.2.47"
3129
LEDGER_LATEST_TAG: "v2.3.0"
3230
steps:
3331
- name: Checkout code
@@ -74,8 +72,6 @@ jobs:
7472
username: ${{ secrets.ANTITHESIS_USERNAME }}
7573
password: ${{ secrets.ANTITHESIS_PASSWORD }}
7674
github_token: ${{ secrets.NUMARY_GITHUB_TOKEN }}
77-
# images: "workload:latest;docker.io/library/postgres:15-alpine;ghcr.io/formancehq/operator:${{ env.OPERATOR_TAG }};ghcr.io/formancehq/operator-utils:${{ env.OPERATOR_UTILS_TAG }};ghcr.io/formancehq/gateway:${{ env.GATEWAY_TAG }};ghcr.io/formancehq/ledger-instrumented:${{ env.LEDGER_PREVIOUS_TAG }};ghcr.io/formancehq/ledger-instrumented:${{ env.LEDGER_LATEST_TAG }}"
78-
# temporary: remove this when support for multiple image versions is added
79-
images: "workload:latest;docker.io/library/postgres:15-alpine;ghcr.io/formancehq/operator:${{ env.OPERATOR_TAG }};ghcr.io/formancehq/operator-utils:${{ env.OPERATOR_UTILS_TAG }};ghcr.io/formancehq/gateway:${{ env.GATEWAY_TAG }};ghcr.io/formancehq/ledger-instrumented:${{ env.LEDGER_LATEST_TAG }}"
75+
images: "workload:latest;docker.io/library/postgres:15-alpine;ghcr.io/formancehq/operator:${{ env.OPERATOR_TAG }};ghcr.io/formancehq/operator-utils:${{ env.OPERATOR_UTILS_TAG }};ghcr.io/formancehq/gateway:${{ env.GATEWAY_TAG }};ghcr.io/formancehq/ledger-instrumented:${{ env.LEDGER_PREVIOUS_TAG }};ghcr.io/formancehq/ledger-instrumented:${{ env.LEDGER_LATEST_TAG }}"
8076
config_image: "antithesis-config:daily_run"
8177
email_recipients: ${{ secrets.ANTITHESIS_SLACK_REPORT_RECIPIENT }}

Earthfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ deploy:
5050
RUN kubectl patch Versions.formance.com default -p "{\"spec\":{\"ledger\": \"${tag}\"}}" --type=merge
5151

5252
deploy-staging:
53-
BUILD --pass-args core+deploy-staging
53+
BUILD --pass-args core+deploy-staging

go.sum

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ github.com/alitto/pond v1.9.2 h1:9Qb75z/scEZVCoSU+osVmQ0I0JOeLfdTDafrbcJ8CLs=
3232
github.com/alitto/pond v1.9.2/go.mod h1:xQn3P/sHTYcU/1BR3i86IGIrilcrGC2LiS+E2+CJWsI=
3333
github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA=
3434
github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA=
35-
github.com/antithesishq/antithesis-sdk-go v0.4.3-default-no-op h1:+OSa/t11TFhqfrX0EOSqQBDJ0YlpmK0rDSiB19dg9M0=
36-
github.com/antithesishq/antithesis-sdk-go v0.4.3-default-no-op/go.mod h1:IUpT2DPAKh6i/YhSbt6Gl3v2yvUZjmKncl7U91fup7E=
37-
github.com/antithesishq/antithesis-sdk-go v0.4.3 h1:a2hGdDogClzHzFu20r1z0tzD6zwSWUipiaerAjZVP90=
38-
github.com/antithesishq/antithesis-sdk-go v0.4.3/go.mod h1:IUpT2DPAKh6i/YhSbt6Gl3v2yvUZjmKncl7U91fup7E=
3935
github.com/antithesishq/antithesis-sdk-go v0.5.0 h1:cudCFF83pDDANcXFzkQPUHHedfnnIbUO3JMr9fqwFJs=
4036
github.com/antithesishq/antithesis-sdk-go v0.5.0/go.mod h1:IUpT2DPAKh6i/YhSbt6Gl3v2yvUZjmKncl7U91fup7E=
4137
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 h1:yL7+Jz0jTC6yykIK/Wh74gnTJnrGr5AyrNMXuA0gves=

internal/storage/driver/driver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import (
44
"context"
55
"errors"
66
"fmt"
7-
"sync"
8-
"time"
97

108
"github.com/antithesishq/antithesis-sdk-go/assert"
119
"github.com/formancehq/ledger/internal/storage/common"
1210
systemstore "github.com/formancehq/ledger/internal/storage/system"
1311
"github.com/formancehq/ledger/internal/tracing"
1412
"go.opentelemetry.io/otel/trace"
1513
"go.opentelemetry.io/otel/trace/noop"
14+
"sync"
15+
"time"
1616

1717
"github.com/alitto/pond"
1818
"github.com/formancehq/go-libs/v3/bun/bunpaginate"

test/antithesis/Justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ run-6min: requirements-push
66
"custom.duration": "0.1", \
77
"antithesis.report.recipients": "'"$ANTITHESIS_SLACK_REPORT_RECIPIENT"'", \
88
"antithesis.config_image": "antithesis-config:daily_run", \
9-
"antithesis.images": "workload:latest;docker.io/library/postgres:15-alpine;ghcr.io/formancehq/operator:v2.10.1;ghcr.io/formancehq/operator-utils:v2.0.14;ghcr.io/formancehq/gateway:v2.0.24;ghcr.io/formancehq/ledger-instrumented:'"$LEDGER_LATEST_TAG"'" \
9+
"antithesis.images": "workload:latest;docker.io/library/postgres:15-alpine;ghcr.io/formancehq/operator:v2.10.1;ghcr.io/formancehq/operator-utils:v2.0.14;ghcr.io/formancehq/gateway:v2.0.24;ghcr.io/formancehq/ledger-instrumented:'"$LEDGER_PREVIOUS_TAG"';ghcr.io/formancehq/ledger-instrumented:'"$LEDGER_LATEST_TAG"'" \
1010
} \
1111
}'
1212

@@ -18,7 +18,7 @@ run-1h: requirements-push
1818
"custom.duration": "1", \
1919
"antithesis.report.recipients": "'"$ANTITHESIS_SLACK_REPORT_RECIPIENT"'", \
2020
"antithesis.config_image": "antithesis-config:daily_run", \
21-
"antithesis.images": "workload:latest;docker.io/library/postgres:15-alpine;ghcr.io/formancehq/operator:v2.10.1;ghcr.io/formancehq/operator-utils:v2.0.14;ghcr.io/formancehq/gateway:v2.0.24;ghcr.io/formancehq/ledger-instrumented:"'"$LEDGER_LATEST_TAG"'" \
21+
"antithesis.images": "workload:latest;docker.io/library/postgres:15-alpine;ghcr.io/formancehq/operator:v2.10.1;ghcr.io/formancehq/operator-utils:v2.0.14;ghcr.io/formancehq/gateway:v2.0.24;ghcr.io/formancehq/ledger-instrumented:'"$LEDGER_PREVIOUS_TAG"';ghcr.io/formancehq/ledger-instrumented:"'"$LEDGER_LATEST_TAG"'" \
2222
} \
2323
}'
2424

test/antithesis/workload/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ COPY pkg/client /src/pkg/client
1313
RUN antithesis-go-instrumentor -assert_only .
1414

1515
RUN go build -o /init ./bin/init
16+
RUN mkdir -p /cmds
1617
RUN for file in $(ls ./bin/cmds/); do go build -o /cmds/$file ./bin/cmds/$file; done
1718

1819
RUN antithesis-go-instrumentor -assert_only .
@@ -27,6 +28,6 @@ ARG LEDGER_LATEST_TAG
2728
COPY --from=compiler /init /init
2829
ENTRYPOINT ["/init"]
2930

30-
COPY --from=compiler cmds/* /opt/antithesis/test/v1/main/
31+
COPY --from=compiler /cmds/* /opt/antithesis/test/v1/main/
3132

3233
RUN echo ${LEDGER_LATEST_TAG} > /ledger_latest_tag

test/antithesis/workload/bin/cmds/eventually_correct/main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ func checkBalanced(ctx context.Context, client *client.Formance, ledger string)
6161
fmt.Sprintf("aggregated volumes for asset %s should be 0",
6262
asset,
6363
), internal.Details{
64-
"error": err,
64+
"asset": asset,
65+
"volumes": volumes,
6566
})
6667
}
6768

@@ -75,8 +76,9 @@ func checkAccountBalances(ctx context.Context, client *client.Formance, ledger s
7576
Ledger: ledger,
7677
Address: address,
7778
})
78-
assert.Sometimes(err != nil, "Client can aggregate account balances", internal.Details{
79+
assert.Sometimes(err == nil, "Client can aggregate account balances", internal.Details{
7980
"ledger": ledger,
81+
"address": address,
8082
"error": err,
8183
})
8284
if err != nil {

test/antithesis/workload/bin/cmds/parallel_driver_transactions/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ func main() {
2020
client := internal.NewClient()
2121

2222
ledger, err := internal.GetRandomLedger(ctx, client)
23+
assert.Sometimes(err == nil, "should be able to get a random ledger", internal.Details{
24+
"error": err,
25+
})
2326
if err != nil {
24-
ledger = "default"
25-
log.Printf("error getting random ledger: %s", err)
2627
return
2728
}
2829

tools/generator/cmd/root.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ import (
55
"crypto/tls"
66
"errors"
77
"fmt"
8-
"net/http"
9-
"os"
10-
"strings"
11-
8+
129
"github.com/formancehq/go-libs/v3/logging"
1310
"github.com/formancehq/go-libs/v3/service"
1411
ledgerclient "github.com/formancehq/ledger/pkg/client"
@@ -19,6 +16,9 @@ import (
1916
"github.com/spf13/cobra"
2017
"golang.org/x/oauth2"
2118
"golang.org/x/oauth2/clientcredentials"
19+
"net/http"
20+
"os"
21+
"strings"
2222
)
2323

2424
const (

tools/generator/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ require (
2121
dario.cat/mergo v1.0.2 // indirect
2222
github.com/ThreeDotsLabs/watermill v1.4.7 // indirect
2323
github.com/alitto/pond v1.9.2 // indirect
24+
github.com/antithesishq/antithesis-sdk-go v0.5.0 // indirect
2425
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect
2526
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
2627
github.com/bahlo/generic-list-go v0.2.0 // indirect

0 commit comments

Comments
 (0)