Skip to content

Commit 8990a0d

Browse files
authored
Massive test suite overhaul [Phase 1] (#66)
* custom it + describe definitions * revised custom previous it + describe definitions * updated tests with new testing util functions * fixed bug in test overhaul impl + made tag names uppercase * more work * more work * fix small bug in tests * DbAdmin now works with astra dev * implemented rough way to run tests in parallel * made a bunch more tests parallel * fix /sigh * fixed bug in parallel testing + added error report * admin lifecycle test no longer needs to manually print error * pgsql is more strict, increase the hackiness up to 11 * a * Reticulating splines... * Some bugs fixed *  - Temporary commit. * fixed bug with vectorize test coll names being duplicated * removing unit tests * Committing in accordance with the prophecy. * minor updates to error reporter * Fixed the fuck out of #194! * My boss forced me to build this feature... Pure shit. * I think now it works * I'll explain this when I'm sober .. or revert it * Locating the required gigapixels to render... * background tests * major refactors to test lib + custom test filtering * better grepping * more vectorize whitelist special functions * better filter inversion * jobs... steve jobs * foo * parallelized a majority of tests * nearly at max test speed now * more work yay * Committing in accordance with the prophecy. * Easteregg * a bunch more work sigh * I know what I am doing. Trust me. * massive change to test filtering * fixe dsome bugs with the impl and stuff idk * lets drink beer * bugger * update to test script * Haiyaa * Don't push this commit * Moved something to somewhere... goodnight... * wip on devguide * more work on test script / devguide * mo work * devguide pretty much done * or not * changed some env vars * fix some typos * Final commit, ready for tagging * Herp derp I left the debug in there and forgot to reset errors. * fixed some tests + changed a few test script flags * See last commit * changed test tags format
1 parent e04c56b commit 8990a0d

File tree

83 files changed

+3611
-3397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+3611
-3397
lines changed

.env.example

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,16 @@
22
# READ THE DEVGUIDE.MD FILE FOR MORE INFORMATION ON HOW TO CONFIGURE THIS FILE #
33
################################################################################
44

5-
# Astra API endpoint
6-
APPLICATION_URI=https://<db_id>-<region>.apps.astra.datastax.com
5+
# Data API endpoint
6+
CLIENT_DB_URL=<endpoint>
77

8-
# Application token, used to authenticate with the Astra API
9-
APPLICATION_TOKEN=AstraCS:<rest_of_token>
8+
# Application token, used to authenticate with the Data API
9+
CLIENT_DB_TOKEN=<token>
1010

1111
# Backend for the Data API (astra | dse | hcd | cassandra | other). Defaults to 'astra'.
12-
APPLICATION_ENVIRONMENT=astra
12+
# CLIENT_DB_ENVIRONMENT=<env>
1313

14-
# Set this to some value to enable running tests that require a $vectorize enabled environment
15-
ASTRA_RUN_VECTORIZE_TESTS=1
16-
17-
# Regex whitelist for vectorize tests to run (test names formatted as providerName@modelName@authType@dimension)
18-
# - where dimension := 'specified' | 'default' | a specific number
19-
# - where authType := 'header' | 'providerKey' | 'none'
20-
# Only needs to match part of the test name to whitelist (use ^$ as necessary)
21-
# VECTORIZE_WHITELIST=^.*@(header|none)@(default|specified)
22-
VECTORIZE_WHITELIST=.*
23-
24-
# Set this to some value to enable running long-running tests
25-
ASTRA_RUN_LONG_TESTS=1
26-
27-
# Set this to some value to enable running admin tests
28-
ASTRA_RUN_ADMIN_TESTS=
29-
30-
# Set this to run tests on HTTP1 by default
31-
ASTRA_USE_HTTP1=
32-
33-
# Set this to use the native fetch instead of fetch-h2
34-
ASTRA_USE_FETCH=
14+
# Uncomment to enable running all (or specific) types of test by default
15+
# CLIENT_RUN_VECTORIZE_TESTS=1
16+
# CLIENT_RUN_LONG_TESTS=1
17+
# CLIENT_RUN_ADMIN_TESTS=1

.eslintrc.cjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@ module.exports = {
2121
],
2222
// Sometimes 'requires' is necessary
2323
'@typescript-eslint/no-var-requires': 'off',
24+
// https://stackoverflow.com/questions/49743842/javascript-unexpected-control-characters-in-regular-expression
25+
"no-control-regex": 0
2426
},
2527
parserOptions: {
2628
ecmaVersion: 'latest',
2729
sourceType: 'module',
2830
project: ['./tsconfig.json'],
2931
tsconfigRootDir: __dirname,
3032
},
33+
env: {
34+
node: true,
35+
}
3136
};

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,4 @@ temp
138138
tsdoc-metadata.json
139139

140140
vectorize_test_spec.json
141+
etc/test-reports/

.np-config.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

DEVGUIDE.md

Lines changed: 235 additions & 103 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@
2727
"license": "Apache-2.0",
2828
"main": "dist/index.js",
2929
"types": "dist/astra-db-ts.d.ts",
30-
"mocha": {
31-
"timeout": 30000,
32-
"require": [
33-
"tests/setup.ts"
34-
]
35-
},
3630
"directories": {
3731
"lib": "src",
3832
"test": "tests"
@@ -51,7 +45,6 @@
5145
"lint": "eslint src/* tests/*",
5246
"test": "sh scripts/test.sh",
5347
"build": "sh scripts/build.sh",
54-
"list-embedding-providers": "chmod +x scripts/list-embedding-providers.sh && scripts/list-embedding-providers.sh",
5548
"version": "sh scripts/version.sh"
5649
},
5750
"bugs": {

scripts/check-licensing.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
#!/usr/bin/sh
2+
13
# Lists out all the files which don't contain the necessary license notice
24
find tests/ src/ -type f -exec grep -L "^// Copyright DataStax, Inc." {} +

scripts/docker-compose-stargate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ services:
2424
retries: 10
2525

2626
data-api:
27-
image: stargateio/data-api:v1.0.12
27+
image: stargateio/data-api:v1.0.14
2828
depends_on:
2929
coordinator:
3030
condition: service_healthy

scripts/list-embedding-providers.sh

100755100644
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
#!/usr/bin/sh
2+
13
# Errors on using unbound variables
24
set -u
35

46
# Properly sources the .env file to bring env variables into scope
5-
eval "$(tr -d '\r' < .env)"
7+
if [ -f .env ]; then
8+
eval "$(tr -d '\r' < .env)"
9+
fi
610

711
# jq strips away the irrelevant fields we don't care about
8-
curl -sL "${APPLICATION_URI}/api/json/v1" \
9-
--header "Token: ${APPLICATION_TOKEN}" \
12+
curl -sL "${CLIENT_DB_URL}/api/json/v1" \
13+
--header "Token: ${CLIENT_DB_TOKEN}" \
1014
--header "Content-Type: application/json" \
1115
--data '{
1216
"findEmbeddingProviders": {}

scripts/setup-stargate-keyspaces-4-tests.sh

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)