Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/modernize bitset #634

Merged
merged 5 commits into from
Jul 6, 2021

Conversation

jimmywarting
Copy link
Contributor

No description provided.

@kibertoad
Copy link
Collaborator

Was there an existing test for this?

@jimmywarting
Copy link
Contributor Author

jimmywarting commented Jun 29, 2021

https://github.com/squaremo/amqp.node/blob/main/test/bitset.js

i run the test, everything passed

@kibertoad
Copy link
Collaborator

You mean the one in /test, right? Maybe we should touch it up a bit to use newer syntax as well?

@jimmywarting
Copy link
Contributor Author

jimmywarting commented Jun 29, 2021

You mean the one in /test, right? Maybe we should touch it up a bit to use newer syntax as well?

yea, sry, copied the wrong link - changed it

sure, i was doing quite a large commit to modernize all files but then i realized it was a bit to much to review. so i basically take one file at the time/PR

@jimmywarting
Copy link
Contributor Author

modernized the test file as well.

@kibertoad
Copy link
Collaborator

LGTM!

@jimmywarting
Copy link
Contributor Author

Test result
  ✓ single input
  ✓ single input, resuming stream
  ✓ two sequential inputs
  ✓ two interleaved inputs
  ✓ unpipe
  ✓ roundrobin
  BitSet
    ✓ get bit
    ✓ clear bit
    ✓ next set of empty
    ✓ next set of one bit
    ✓ next set same bit
    ✓ next set following bit
    ✓ next clear of empty
    ✓ next clear of one set

  versionGreaterThan
    ✓ full spec
    ✓ partial spec
    ✓ not greater

  connect
    ✓ at all

  channel open
    ✓ at all
    ✓ open and close

  assert, check, delete
    ✓ assert, check, delete queue (68ms)
    ✓ assert, check, delete exchange (129ms)
    ✓ fail on check non-queue
    ✓ fail on check non-exchange

  bindings
    ✓ bind queue
    ✓ bind exchange

  sending messages
    ✓ send to queue and consume noAck
    ✓ send to queue and consume ack
    ✓ send to and get from queue

  ConfirmChannel
    ✓ Receive confirmation
    ✓ Wait for confirms (55ms)

  Error handling
    ✓ Throw error in connection open callback
    ✓ Channel open callback throws an error
    ✓ RPC callback throws error
    ✓ Get callback throws error
    ✓ Consume callback throws error
    ✓ Get from non-queue invokes error k
    ✓ Consume from non-queue invokes error k

  Connection errors
    ✓ socket close during open
    ✓ bad frame during open

  Connection open
    ✓ happy
    ✓ wrong first frame
    ✓ unexpected socket close

  Connection running
    ✓ wrong frame on channel 0
    ✓ unopened channel
    ✓ unexpected socket close
    ✓ connection.blocked
    ✓ connection.unblocked

  Connection close
    ✓ happy
    ✓ interleaved close frames
    ✓ server error close
    ✓ operator-intiated close
    ✓ double close

  heartbeats
    ✓ send heartbeat after open
    ✓ detect lack of heartbeats (62ms)

  channel open and close
    ✓ open
    ✓ bad server
    ✓ open, close
    ✓ server close
    ✓ overlapping channel/server close
    ✓ double close

  channel machinery
    ✓ RPC
    ✓ Bad RPC
    ✓ RPC on closed channel
    ✓ publish all < single chunk threshold
    ✓ publish content > single chunk threshold
    ✓ publish method & headers > threshold
    ✓ publish zero-length message
    ✓ delivery
    ✓ zero byte msg
    ✓ bad delivery
    ✓ bad content send
    ✓ bad properties send
    ✓ bad consumer
    ✓ bad send in consumer
    ✓ return
    ✓ cancel
    ✓ confirm ack
    ✓ confirm nack
    ✓ out-of-order acks
    ✓ not all out-of-order acks

  connect
    ✓ at all
    ✓ create channel

  assert, check, delete
    ✓ assert and check queue
    ✓ assert and check exchange
    ✓ fail on reasserting queue with different options
    ✓ fail on checking a queue that's not there
    ✓ fail on checking an exchange that's not there
    ✓ fail on reasserting exchange with different type
    ✓ channel break on publishing to non-exchange
    ✓ delete queue (71ms)
    ✓ delete exchange (223ms)

  sendMessage
    ✓ send to queue and get from queue
    ✓ send (and get) zero content to queue

  binding, consuming
    ✓ route message
    ✓ purge queue
    ✓ unbind queue
    ✓ consume via exchange-exchange binding
    ✓ unbind exchange
    ✓ cancel consumer
    ✓ cancelled consumer (70ms)
    ✓ ack
    ✓ nack
    ✓ reject
    ✓ prefetch
    ✓ close

  confirms
    ✓ message is confirmed
    ✓ multiple confirms
    ✓ wait for confirms (44ms)
    ✓ works when channel is closed (68ms)

  Implicit encodings
    ✓ byte
    ✓ byte max value
    ✓ byte min value
    ✓ < -128 promoted to signed short
    ✓ > 127 promoted to short
    ✓ < 2^15 still a short
    ✓ -2^15 still a short
    ✓ >= 2^15 promoted to int
    ✓ < -2^15 promoted to int
    ✓ < 2^31 still an int
    ✓ >= -2^31 still an int
    ✓ >= 2^31 promoted to long
    ✓ < -2^31 promoted to long
    ✓ float value
    ✓ negative float value
    ✓ string
    ✓ byte array from buffer
    ✓ true
    ✓ false
    ✓ null
    ✓ array
    ✓ object
    ✓ timestamp
    ✓ decimal
    ✓ float

  Domains
    ✓ <octet> domain
    ✓ <shortstr> domain
    ✓ <longstr> domain
    ✓ <short-uint> domain
    ✓ <long-uint> domain
    ✓ <longlong-uint> domain
    ✓ <short-int> domain
    ✓ <long-int> domain
    ✓ <longlong-int> domain
    ✓ <bit> domain
    ✓ <double> domain
    ✓ <float> domain
    ✓ <decimal> domain
    ✓ <timestamp> domain
    ✓ <table> domain
    ✓ <field-array> domain (75ms)

  Roundtrip values
    ✓ <octet> roundtrip
    ✓ <shortstr> roundtrip
    ✓ <longstr> roundtrip
    ✓ <short-uint> roundtrip
    ✓ <long-uint> roundtrip
    ✓ <longlong-uint> roundtrip
    ✓ <short-uint> roundtrip
    ✓ <short-int> roundtrip
    ✓ <long-int> roundtrip
    ✓ <bit> roundtrip
    ✓ <decimal> roundtrip
    ✓ <timestamp> roundtrip
    ✓ <double> roundtrip
    ✓ <float> roundtrip
    ✓ <field-array> roundtrip
    ✓ <table> roundtrip

  Roundtrip methods
    ✓ <ConnectionStart> roundtrip
    ✓ <ConnectionStartOk> roundtrip
    ✓ <ConnectionSecure> roundtrip
    ✓ <ConnectionSecureOk> roundtrip
    ✓ <ConnectionTune> roundtrip
    ✓ <ConnectionTuneOk> roundtrip
    ✓ <ConnectionOpen> roundtrip
    ✓ <ConnectionOpenOk> roundtrip
    ✓ <ConnectionClose> roundtrip
    ✓ <ConnectionCloseOk> roundtrip
    ✓ <ConnectionBlocked> roundtrip
    ✓ <ConnectionUnblocked> roundtrip
    ✓ <ChannelOpen> roundtrip
    ✓ <ChannelOpenOk> roundtrip
    ✓ <ChannelFlow> roundtrip
    ✓ <ChannelFlowOk> roundtrip
    ✓ <ChannelClose> roundtrip
    ✓ <ChannelCloseOk> roundtrip
    ✓ <AccessRequest> roundtrip
    ✓ <AccessRequestOk> roundtrip
    ✓ <ExchangeDeclare> roundtrip
    ✓ <ExchangeDeclareOk> roundtrip
    ✓ <ExchangeDelete> roundtrip
    ✓ <ExchangeDeleteOk> roundtrip
    ✓ <ExchangeBind> roundtrip
    ✓ <ExchangeBindOk> roundtrip
    ✓ <ExchangeUnbind> roundtrip
    ✓ <ExchangeUnbindOk> roundtrip
    ✓ <QueueDeclare> roundtrip
    ✓ <QueueDeclareOk> roundtrip
    ✓ <QueueBind> roundtrip
    ✓ <QueueBindOk> roundtrip
    ✓ <QueuePurge> roundtrip
    ✓ <QueuePurgeOk> roundtrip
    ✓ <QueueDelete> roundtrip
    ✓ <QueueDeleteOk> roundtrip
    ✓ <QueueUnbind> roundtrip
    ✓ <QueueUnbindOk> roundtrip
    ✓ <BasicQos> roundtrip
    ✓ <BasicQosOk> roundtrip
    ✓ <BasicConsume> roundtrip
    ✓ <BasicConsumeOk> roundtrip
    ✓ <BasicCancel> roundtrip
    ✓ <BasicCancelOk> roundtrip
    ✓ <BasicPublish> roundtrip
    ✓ <BasicReturn> roundtrip
    ✓ <BasicDeliver> roundtrip
    ✓ <BasicGet> roundtrip
    ✓ <BasicGetOk> roundtrip
    ✓ <BasicGetEmpty> roundtrip
    ✓ <BasicAck> roundtrip
    ✓ <BasicReject> roundtrip
    ✓ <BasicRecoverAsync> roundtrip
    ✓ <BasicRecover> roundtrip
    ✓ <BasicRecoverOk> roundtrip
    ✓ <BasicNack> roundtrip
    ✓ <TxSelect> roundtrip
    ✓ <TxSelectOk> roundtrip
    ✓ <TxCommit> roundtrip
    ✓ <TxCommitOk> roundtrip
    ✓ <TxRollback> roundtrip
    ✓ <TxRollbackOk> roundtrip
    ✓ <ConfirmSelect> roundtrip
    ✓ <ConfirmSelectOk> roundtrip

  Roundtrip properties
    ✓ <BasicProperties> roundtrip

  Credentials
    ✓ no creds
    ✓ usual user:pass
    ✓ missing user
    ✓ missing password
    ✓ escaped colons

  Connect API
    ✓ Connection refused
    ✓ bad URL
    ✓ wrongly typed open option
    ✓ serverProperties
    ✓ using custom heartbeat option
    ✓ wrongly typed heartbeat option
    ✓ using plain credentials
    ✓ using amqplain credentials
    ✓ using unsupported mechanism
    ✓ with a given connection timeout (55ms)

  Explicit parsing
    ✓ Parse heartbeat
    ✓ Parse partitioned
    ✓ Wrong sized frame
    ✓ Unknown method frame
    ✓ > max frame

  Parsing
    ✓ Parse trace of methods (44ms)
    ✓ Parse concat'd methods
    ✓ Parse partitioned methods

  Content framing
    ✓ Adhere to frame max (137ms)


  256 passing (2s)

@kibertoad
Copy link
Collaborator

kibertoad commented Jun 29, 2021

It might make sense to consider adding GitHub Actions for proper CI, looks like Travis is broken again.
Not in this PR, in general.

@jimmywarting
Copy link
Contributor Author

Since June 15th, 2021, the building on travis-ci.org is ceased. Please use travis-ci.com from now on.

related?

@squaremo
Copy link
Collaborator

squaremo commented Jul 6, 2021

Super, so nice to see up-to-date syntax. Thank you!

@squaremo squaremo merged commit fe53e18 into amqp-node:main Jul 6, 2021
@jimmywarting jimmywarting deleted the feature/modernize-bitset branch July 6, 2021 21:49
@cressie176 cressie176 mentioned this pull request May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants