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

CC-1299: Implement Transactions extension stages #154

Merged
merged 24 commits into from
Jun 14, 2024

Commits on Jun 13, 2024

  1. feat: add tests for stages 1 - 3

    Use MultiCommandTestCase for testTxIncr1, testTxIncr2, and testTxIncr3
    ryan-gang committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    fecf766 View commit details
    Browse the repository at this point in the history
  2. feat: Add testTxMulti function to internal package

    This commit adds the testTxMulti function to the internal package. The function sets up a Redis executable and creates an instrumented RESP connection. It then runs a command test case using the MULTI command with no arguments, asserting that the response is "OK".
    ryan-gang committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    fb6e805 View commit details
    Browse the repository at this point in the history
  3. feat: Add testTxEmpty function to internal package

    This commit adds the testTxEmpty function to the internal package. The function tests an empty transaction by running a Redis executable and executing various test cases. It includes assertions for error handling and ensures that the EXEC command without MULTI returns an error.
    ryan-gang committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    11c4a5c View commit details
    Browse the repository at this point in the history
  4. feat: Add testTxQueue function for testing transaction queue

    This commit adds the `testTxQueue` function to the internal package. The function sets up a Redis executable and creates two instrumented RESP connections. It then runs a transaction test case, followed by a command test case. This new function will be used for testing the transaction queue functionality.
    ryan-gang committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    2c4393a View commit details
    Browse the repository at this point in the history
  5. feat: Add testTxExec function

    This commit adds the `testTxExec` function to the internal package. The function sets up a Redis executable, creates an instrumented RESP connection, and runs a test case for the `EXEC` command.
    ryan-gang committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    2003c23 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c1e381f View commit details
    Browse the repository at this point in the history
  7. feat: Add multiple clients to testTxErr, testTxSuccess, and testTxDis…

    …card
    
    - Added support for multiple clients in the functions `testTxErr`, `testTxSuccess`, and `testTxDiscard`.
    - Each client is created with a unique name using the format "client-{index+1}".
    - The clients are stored in an array for later use.
    - The clients are closed using the `Close` method before returning from the function.
    ryan-gang committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    a5de8c0 View commit details
    Browse the repository at this point in the history
  8. feat: Add spawnClients function

    This commit adds the `spawnClients` function. The `spawnClients` function is responsible for creating a specified number of client connections to a given address. It takes in the number of clients, address, stage harness, and logger as parameters. The function creates the clients and appends them to a slice before returning it. This new function is used in multiple places throughout the codebase to create client connections.
    ryan-gang committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    983add3 View commit details
    Browse the repository at this point in the history
  9. feat: Update function name and add documentation for spawning clients

    - Renamed the `spawnClients` function to `SpawnClients`
    - Added documentation for the `SpawnClients` function, explaining its purpose and usage
    - The `SpawnClients` function creates multiple clients connected to a given address using the `instrumented_resp_connection.NewFromAddr` function
    - Clients are expected to be closed after use
    ryan-gang committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    035058f View commit details
    Browse the repository at this point in the history
  10. feat: update tester_definition with new test cases for transactions

    This commit adds new test cases for transaction functionality. The added test cases cover various stages of transactions, including INCR, MULTI, EXEC, and more. These tests ensure that the transaction functionality is working as expected.
    
    - Added new test cases for transaction functionality
    - Covered stages such as INCR-1, INCR-2, INCR-3, MULTI, EXEC, Empty Transaction, Queueing Commands
    - Ensured proper execution and handling of failed transactions
    ryan-gang committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    b0e7962 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    0bd8bac View commit details
    Browse the repository at this point in the history
  12. refactor: Rename test stages from numbered stages to named stages

    This commit renames several files in the internal directory for better clarity and organization. The changes include renaming `test_txn_9.go` to `test_txn_discard.go`, `test_txn_11.go` to `test_txn_multi_tx.go`, `test_txn_8.go` to `test_txn_tx.go`, and `test_txn_10.go` to `test_txn_tx_failure.go`. These file name updates improve the readability and maintainability of the codebase.
    ryan-gang committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    28be476 View commit details
    Browse the repository at this point in the history
  13. refactor: improve transaction test cases

    - Skip execution of transaction commands
    - Use `RunAll` instead of `RunMulti` and `RunQueueAll`
    - Update result array for each transaction command
    ryan-gang committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    a3957c1 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    f2c6762 View commit details
    Browse the repository at this point in the history
  15. feat: Add support for Transactions extension

    This commit adds the "Transactions" extension to the Redis implementation. It includes the implementation of commands such as MULTI, EXEC, DISCARD, and handling failures within transactions. The extension also introduces stages for implementing the INCR command in multiple steps.
    ryan-gang committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    a764c12 View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2024

  1. Configuration menu
    Copy the full SHA
    7b04ff9 View commit details
    Browse the repository at this point in the history
  2. feat: Refactor transaction test cases

    - Removed the ShouldSkipExec flag from the TransactionTestCase struct
    - Renamed the RunAll method to RunWithoutExec in the TransactionTestCase struct
    - Updated test_txn_discard.go, test_txn_multi.go, test_txn_multi_tx.go, and test_txn_queue.go to use the RunWithoutExec method instead of RunAll
    ryan-gang committed Jun 14, 2024
    Configuration menu
    Copy the full SHA
    715817c View commit details
    Browse the repository at this point in the history
  3. feat: add randomness to test case for transaction failure

    This commit adds a new test case to the `testTxErr` function in `internal/test_txn_tx_failure.go`. The test case includes commands to set random values for two keys, and then increment those values within a transaction. The expected result is an error value indicating that the value is not an integer or out of range, followed by the incremented value. After running the transaction, there are assertions to check if the values were updated correctly.
    
    The purpose of this change is to ensure that transactions handle errors properly and provide accurate results when dealing with non-integer values.
    ryan-gang committed Jun 14, 2024
    Configuration menu
    Copy the full SHA
    571cdf7 View commit details
    Browse the repository at this point in the history
  4. feat: add randomness to test case for transaction success

    This commit adds a new transaction test case to the `testTxSuccess` function in `internal/test_txn_tx.go`. The test case includes commands for setting random keys with random integer values, incrementing the values, and retrieving them. The expected results are updated accordingly. Additionally, a command test case is added to verify the final value of one of the keys.
    ryan-gang committed Jun 14, 2024
    Configuration menu
    Copy the full SHA
    a37aa7b View commit details
    Browse the repository at this point in the history
  5. feat: add random key generation for INCR test cases

    This commit adds the functionality to generate random keys for test cases in `test_txn_incr1.go`, `test_txn_incr2.go`, and `test_txn_incr3.go`. The generated keys are used in the `SET` and `INCR` commands. This change improves the flexibility and randomness of the test cases.
    ryan-gang committed Jun 14, 2024
    Configuration menu
    Copy the full SHA
    af87ab5 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4bf9120 View commit details
    Browse the repository at this point in the history
  7. feat: Add randomness to test cases for transaction discard

    This commit adds new test cases to the `testTxDiscard` function in `internal/test_txn_discard.go`. The changes include:
    - Importing the `fmt` package
    - Generating unique keys using the `random.RandomWords` function
    - Generating random integers using the `random.RandomInt` function
    - Modifying the command arguments to use the generated keys and random integers
    - Updating assertions to use the generated values
    
    These changes enhance the test coverage for transaction discards.
    ryan-gang committed Jun 14, 2024
    Configuration menu
    Copy the full SHA
    63b9b01 View commit details
    Browse the repository at this point in the history
  8. feat: add randomness to concurrent txn test

    - In test_txn_discard, changed the number of uniqueKeys generated from 3 to 2.
    - In test_txn_multi_tx, updated the commands to set key2 with a random integer value and increment key1.
    - Also added a comment explaining the expected result in each transaction.
    - In test_txn_queue, updated the command to set a random key with a random integer value and increment it.
    ryan-gang committed Jun 14, 2024
    Configuration menu
    Copy the full SHA
    263a9cb View commit details
    Browse the repository at this point in the history
  9. tests: update fixtures

    ryan-gang committed Jun 14, 2024
    Configuration menu
    Copy the full SHA
    3f032d4 View commit details
    Browse the repository at this point in the history