mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-03 06:35:51 +00:00
Before this patch, we read either an attribute name like "name" or a reference to one "#name", as one type of token - NAME. However, while attribute paths indeed can use either one, in some other contexts - such as a function name - only "name" is allowed, so we need to distinguish between two types of tokens: NAME and NAMEREF. While separating those, I noticed that we incorrectly allowed a "#" followed by *zero* alphanumeric characters to be considered a NAMEREF, which it shouldn't. In other words, NAMEREF should have ALNUM+, not ALNUM*. Same for VALREF, which can't be just a ":" with nothing after it. So this patch fixes these mistakes, and adds tests for them. Signed-off-by: Nadav Har'El <nyh@scylladb.com>
Tests for Alternator that should also pass, identically, against DynamoDB.
Tests use the boto3 library for AWS API, and the pytest frameworks (both are available from Linux distributions, or with "pip install").
To run tests against AWS and not just a local Scylla installation, the files ~/.aws/credentials should be configured with your AWS key:
[default]
aws_access_key_id = XXXXXXXXXXXXXXXXXXXX
aws_secret_access_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
and ~/.aws/config with the default region to use in the test:
[default]
region = us-east-1
- Running "pytest" runs all tests.
- To run all tests in a single file, do
pytest test_table.py. - To run a single specific test, do
pytest test_table.py::test_create_table_unsupported_names. - By default test run against a local Scylla installation at
http://localhost:8000. Add the "--aws" option to test against AWS instead
(the us-east-1 region).
For example -
pytest --aws test_item.pyorpytest --aws. - Additional useful pytest options, especially useful for debugging tests:
- -v: show the names of each individual test running instead of just dots.
- -s: show the full output of running tests (by default, pytest captures the test's output and only displays it if a test fails)