Conversation
Signed-off-by: Tulir Asokan <tulir@maunium.net>
|
Not sure what that test failure is 🤔 |
complement/.github/workflows/ci.yaml Line 121 in 12210e3 (I fixed this in a repo somewhere to prevent this obtuse error from shadowing the real one, but currently failing to find it or the solution...) |
This reverts commit ce4bdcd.
.github/workflows/ci.yaml
Outdated
| - run: | | ||
| set -o pipefail && | ||
| ${{ matrix.env }} go test -v -json -tags "${{ matrix.tags }}" -timeout "${{ matrix.timeout }}" ./tests ./tests/csapi ${{ matrix.packages }} | .ci/scripts/gotestfmt | ||
| ${{ matrix.env }} go test -v -json -tags "${{ matrix.tags }}" -timeout "${{ matrix.timeout }}" ./tests ./tests/csapi ${{ matrix.packages }} # | .ci/scripts/gotestfmt |
There was a problem hiding this comment.
panic: BUG: Empty package name encountered.will occur whengotestfmtreceives an error and isn't able to parse the output. Try temporarily removing| .ci/scripts/gotestfmtfrom the following line in CI:
We did this in Synapse for example, element-hq/synapse#19326
|
It was just a compile error, tests should pass now |
tests/csapi/invalid_test.go
Outdated
| for _, testCase := range testCases { | ||
| res := alice.Do(t, "POST", []string{"_matrix", "client", "v3", "rooms", roomID, "send", "complement.dummy"}, client.WithJSONBody(t, testCase)) | ||
| for i, testCase := range testCases { | ||
| res := alice.Do(t, "PUT", []string{"_matrix", "client", "v3", "rooms", roomID, "send", "complement.dummy", fmt.Sprintf("invalidnum-%d", i)}, client.WithJSONBody(t, testCase)) |
There was a problem hiding this comment.
Spec for reference: PUT /_matrix/client/v3/rooms/{roomId}/send/{eventType}/{txnId}
tests/csapi/invalid_test.go
Outdated
| for _, testCase := range testCases { | ||
| res := alice.Do(t, "POST", []string{"_matrix", "client", "v3", "rooms", roomID, "send", "complement.dummy"}, client.WithJSONBody(t, testCase)) | ||
| for i, testCase := range testCases { | ||
| res := alice.Do(t, "PUT", []string{"_matrix", "client", "v3", "rooms", roomID, "send", "complement.dummy", fmt.Sprintf("invalidnum-%d", i)}, client.WithJSONBody(t, testCase)) |
There was a problem hiding this comment.
The "invalidnum" makes me think this a particular detail that matters. But it's actually the invalid number testCases above that matter.
Can we just use txn-xxx instead? I'm guessing we're just trying to namespace them to avoid tests colliding with each other. Perhaps we can just do this like we have in other tests:
complement/tests/room_timestamp_to_event_test.go
Lines 256 to 264 in 12210e3
There was a problem hiding this comment.
Extracted all the transaction ids (this one, the comment below and the old getTxnID) into a new method in the helpers package
tests/csapi/room_messages_test.go
Outdated
| ) | ||
|
|
||
| // sytest: POST /rooms/:room_id/send/:event_type sends a message | ||
| // sytest: PUT /rooms/:room_id/send/:event_type/:txn_id sends a message |
There was a problem hiding this comment.
The xxx part of sytest: xxx part might matter and need to match the name in Sytest?
There was a problem hiding this comment.
There was a problem hiding this comment.
Given this test is being removed in matrix-org/sytest#1419, I think we can just remove this comment entirely
There was a problem hiding this comment.
Oh right, there's already another test below for the transaction ID version
MadLittleMods
left a comment
There was a problem hiding this comment.
Looks good, just a few clean-up items
| var txnCounter atomic.Int64 | ||
| var start = time.Now().Unix() | ||
|
|
||
| func GetTxnID(prefix string) (txnID string) { |
There was a problem hiding this comment.
We should add a doc comment for what this does and is useful for
The txn send endpoint is tested below, so TestSendAndFetchMessage is only relevant for testing /messages
For element-hq/synapse#19557