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

Sweep: Add more query tests #26

Open
7 tasks done
lveillard opened this issue Nov 1, 2023 · 1 comment
Open
7 tasks done

Sweep: Add more query tests #26

lveillard opened this issue Nov 1, 2023 · 1 comment
Labels

Comments

@lveillard
Copy link
Member

lveillard commented Nov 1, 2023

Todo:

  • Try to identify missing tests in the queries and add at least 10 new tests that cover typical DB queries that are not present in the current tests.

  • If you miss some data in the database for some particular tests (data is here (test/mocks/data.tql ) you can suggest new lines of data as well

Context files:

  • test/mocks/data.tql //the current data in the test DB that can be queries
  • tests/mocks/testSchema.ts // this is the current schema that holds the definitions and relations of the different items

Files to change:

  • test/unit/queries/query.test.ts
Checklist
  • Modify tests/unit/queries/query.test.ts73cd014
  • Check tests/unit/queries/query.test.ts
  • Modify package.json ! No changes made
  • Modify .eslintrc ! No changes made
  • Check tests/unit/queries/query.test.ts
  • Modify tests/mocks/data.tqld29d060
  • Check tests/mocks/data.tql

Flowchart

@sweep-ai sweep-ai bot added the sweep label Nov 1, 2023
Copy link
Contributor

sweep-ai bot commented Nov 1, 2023

Here's the PR! #27.

Sweep Basic Tier: I'm using GPT-4. You have 5 GPT-4 tickets left for the month and 3 for the day.

For more GPT-4 tickets, visit our payment portal. For a one week free trial, try Sweep Pro (unlimited GPT-4 tickets).

Actions (click)

  • ↻ Restart Sweep
Install Sweep Configs: Pull Request

Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description.

},
},
},
'User-Sessions': {
defaultDBConnector: { id: 'default', path: 'User-Sessions' },
idFields: ['id'],
dataFields: [{ ...id }],
roles: {
user: {
cardinality: 'ONE',
},
sessions: {
cardinality: 'MANY',
},
},
},
'Space-User': {
idFields: ['id'],
defaultDBConnector: { id: 'default', path: 'Space-User' },
dataFields: [{ ...id }],
roles: {
spaces: { cardinality: 'MANY' },
users: { cardinality: 'MANY' },
power: { cardinality: 'ONE' },
},
},
'UserTag': {
idFields: ['id'],
defaultDBConnector: { id: 'default', path: 'UserTag' },
dataFields: [{ ...id }, { ...name }],
roles: {
users: {
cardinality: 'MANY',
},
},
linkFields: [
{
path: 'color',
target: 'role',
cardinality: 'ONE',
plays: 'tags',
relation: 'UserTagGroup',
},
{
path: 'group',
target: 'relation',
cardinality: 'ONE',
plays: 'tags',
relation: 'UserTagGroup',
},
],
},
'UserTagGroup': {
idFields: ['id'],
defaultDBConnector: { id: 'default', path: 'UserTagGroup' },
dataFields: [{ ...id }],
roles: {
tags: {
cardinality: 'MANY',
},
color: {
cardinality: 'ONE',
},
space: {
cardinality: 'ONE',
},
},
},
'SpaceObj': {
idFields: ['id'],
defaultDBConnector: { id: 'default', path: 'SpaceObj' }, // in the future multiple can be specified in the config file. Either they fetch full schemas or they will require a relation to merge attributes from different databases
dataFields: [id],
roles: {
space: {
cardinality: 'ONE',
},
},
},
'SpaceDef': {
extends: 'SpaceObj',
defaultDBConnector: { id: 'default', as: 'SpaceObj', path: 'SpaceDef' }, // in the future multiple can be specified in the config file. Either they fetch full schemas or they will require a relation to merge attributes from different databases
dataFields: [description],
},
'Kind': {
extends: 'SpaceDef',
dataFields: [{ ...string, path: 'name', rights: ['CREATE', 'UPDATE'] }],
linkFields: [
{
path: 'fields',
relation: 'Field',
cardinality: 'MANY',
plays: 'kinds',
target: 'relation',
},
{
path: 'dataFields',
relation: 'DataField',
cardinality: 'MANY',
plays: 'kinds',
target: 'relation',
},
],
defaultDBConnector: { id: 'default', as: 'SpaceDef', path: 'Kind' }, // in the future multiple can be specified in the config file. Either they fetch full schemas or they will require a relation to merge attributes from different databases
},
'Field': {
extends: 'SpaceDef',
dataFields: [
{ ...string, path: 'name' },
{ ...string, path: 'cardinality' },
],
roles: {
kinds: {
cardinality: 'MANY',
},
},
defaultDBConnector: { id: 'default', as: 'SpaceDef', path: 'Field' }, // in the future multiple can be specified in the config file. Either they fetch full schemas or they will require a relation to merge attributes from different databases
},
'DataField': {
extends: 'Field',
dataFields: [
{ ...string, path: 'type' },
{ ...string, path: 'computeType' },
],
defaultDBConnector: { id: 'default', as: 'Field', path: 'DataField' }, // in the future multiple can be specified in the config file. Either they fetch full schemas or they will require a relation to merge attributes from different databases
},
'Self': {
idFields: ['id'],
extends: 'SpaceObj',
defaultDBConnector: { id: 'default', as: 'SpaceObj', path: 'Self' },
roles: {
owner: {
cardinality: 'ONE',
},
},
linkFields: [
{
path: 'owned',
cardinality: 'MANY',
relation: 'Self',
plays: 'owner',
target: 'relation',
},
],
},
},

blitz-orm/readme.md

Lines 1 to 79 in 2abe786

# Blitz-orm
Blitz-orm is an Object Relational Mapper (ORM) for graph databases that uses a JSON query language called Blitz Query Language (BQL). BQL is similar to GraphQL but uses JSON instead of strings. This makes it easier to build dynamic queries.
Blitz-orm is similar to other ORM packages such as Prisma. You define a BQL schema and it gets translated to different databases (currently only compatible with TypeDB but a dgraph adapter in the oven).
## Compatibility
Currently, the only database that is compatible with Blitz-orm is TypeDB. The goal is to build adapters for other graph databases such as Dgraph and Neo4j, as well as classic databases like PostgreSQL and MongoDB in the future.
## How to Use
1. Install the package using your package manager, for example:
`yarn add @blitznocode/blitz-orm`
2. Create a Borm schema. You can find an example in the test folder.
3. The borm.define() function is currently not working, so you will need to manually translate your BQL schema into a TypeQL schema (an example can be found in the test folder).
4. Create a configuration file with the database name that you have created in TypeDB.
5. Initialize Blitz-orm in a file like this:
```
import BormClient from '@blitznocode/blitz-orm';
import { bormConfig } from './borm.config';
import { schema } from './schema';
const bormClient = new BormClient({
schema,
config: bormConfig,
});
export default bormClient;
```
6. You can then run queries and mutations like this:
```
const res = await bormClient.mutate({$entity: 'User', name: 'Ann'}, { noMetadata: true });
```
## Gotchas
1) There is no borm.define() method yet. This means you will need to translate your borm schema into typeQL schema manually
2) Private (non shared) attributes are defined in typeDB as "nameOfTheThing·nameOfTheAttribute", where "·" is a mid-do. As an example:
```
#shared attribute (shared: true) :
title sub attribute, value string;
#as a private attribute (shared: false), default behaviour:
book·title sub attribute, value string;
```
## Documentation & example queries
You can find example mutations and queries in the tests
There is no official documentation but you can check the draft RFC:
https://www.notion.so/blitzapps/BlitzORM-RFC-eb4a5e1464754cd7857734eabdeaa73c
The RFC includes future features and is not updated so please keep an eye on the query and mutation tests as those are designed for the features already working.
## How to Run TypeDB Locally
To run TypeDB locally, follow the official instructions at https://docs.vaticle.com/docs/running-typedb/install-and-run. It is recommended to run TypeDB Studio, define the schema there, and test with pure TypeQL before using Blitz-orm.
## Collaboration & Contact
You can contribute to the project by adding adapters for other databases, developing a BQL-to-GraphQL mapper, enhancing performance, or contributing to the public roadmap for this package (not yet published). To get in touch, please send an email to [email protected].
## Warning
Blitz-orm is currently in alpha version and not ready for production use. Some key queries and mutations do work, but there is still much that needs to be done and performance improvements are needed. One of the biggest performance issues is with nested queries, as they currently require a call to TypeDB for each level of depth.
## What is Currently Working
To see what is currently working and find examples, please check the test folder, where you will find a variety of queries and mutations.
## TypeGen
This orm includes a basic typeGen that gets you types depending on the structure of the borm Schema. You can use it like this:
```
type UserType = GenerateType<typeof typesSchema.relations.User>;
```
Due to typescript limitations and also to be able to type fields from extended things, you will need to compile your bormSchema to a particular format. In order to make this work you can see the example that we have in the tests that you can run with `pnpm test:buildSchema`.
You can also use it with your base schema without compiling but some fields might not be there and you might need to ignore some ts errors. Also you will need "as const" at the end of your schema.
## The future of this package
- Achieve 100% compatibility with typeDB functions
- Enhance functionality with new features such as, cardinality management, ordered attributes, Vectors (ordered relations)...
- Expand compatibility to other graph databases and traditional databases such as PostgreSQL or MongoDB
- Enable the ability to split queries and mutations across multiple databases (for example, some data stored in PostgreSQL and other data in typeQL, all queried from a single point)
## Development
- We use pnpm as a package manager

path: 'description',
contentType: 'TEXT',
cardinality: 'ONE',
};
const timestamp: DataField = {
path: 'timestamp',
cardinality: 'ONE',
contentType: 'DATE',
};
const string: Omit<DataField, 'path'> = {
cardinality: 'ONE',
contentType: 'TEXT',
};
const id: DataField = {
shared: true,
path: 'id',
cardinality: 'ONE',
default: { type: 'function', value: () => uuidv4() },
validations: { required: true, unique: true },
contentType: 'ID',
rights: ['CREATE'],
};
export const testSchema: BormSchema = {
entities: {
Thing: {
idFields: ['id'], // could be a composite key
defaultDBConnector: { id: 'default', path: 'Thing' }, // in the future multiple can be specified in the config file. Either they fetch full schemas or they will require a relation to merge attributes from different databases
dataFields: [
{ ...id },
{
path: 'stuff',
contentType: 'TEXT',
cardinality: 'ONE',
rights: ['CREATE', 'UPDATE', 'DELETE'],
},
],
linkFields: [
{
path: 'things',
cardinality: 'MANY',
relation: 'ThingRelation',
plays: 'things',
target: 'role',
},
{
path: 'root',
cardinality: 'ONE',
relation: 'ThingRelation',
plays: 'root',
target: 'role',
},
{
path: 'extra',
cardinality: 'ONE',
relation: 'ThingRelation',
plays: 'extra',
target: 'role',
},
],
},
SubthingOne: {
extends: 'Thing',
defaultDBConnector: { id: 'default' },
},
SubthingTwo: {
extends: 'Thing',
defaultDBConnector: { id: 'default' },
},
Account: {
idFields: ['id'], // could be a composite key
defaultDBConnector: { id: 'default', path: 'Account' }, // in the future multiple can be specified in the config file. Either they fetch full schemas or they will require a relation to merge attributes from different databases
dataFields: [
{ ...id },
{
path: 'provider',
contentType: 'TEXT',
cardinality: 'ONE',
rights: ['CREATE', 'UPDATE', 'DELETE'],
},
],
linkFields: [
{
path: 'user',
cardinality: 'ONE',
relation: 'User-Accounts',
plays: 'accounts',
target: 'role',
/// rights => Either you want to make it 1) read only 2)replace only 3) update only 4) delete only 5) create only ...
},
],
},
User: {
idFields: ['id'], // could be a namecomposite key
defaultDBConnector: { id: 'default' }, // in the future multiple can be specified in the config file. Either they fetch full schemas or they will require a relation to merge attributes from different databases
dataFields: [
id,
{ ...name, rights: ['CREATE', 'UPDATE'] },
{
path: 'email',
cardinality: 'ONE',
contentType: 'EMAIL',
validations: { unique: true },
rights: ['CREATE', 'DELETE', 'UPDATE'],
},
],
linkFields: [
{
path: 'accounts',
relation: 'User-Accounts',
cardinality: 'MANY',
plays: 'user',
target: 'role',
},
{
path: 'sessions',
relation: 'User-Sessions',
cardinality: 'MANY',
plays: 'user',
target: 'role',
},
{
path: 'spaces',
relation: 'Space-User',
cardinality: 'MANY',
plays: 'users',
target: 'role',
},
{
path: 'user-tags',
relation: 'UserTag',
cardinality: 'MANY',
plays: 'users',
target: 'relation',
},
],
},
SuperUser: {
extends: 'User',
defaultDBConnector: { id: 'default' },
dataFields: [
{
path: 'power',
contentType: 'TEXT',
cardinality: 'ONE',
},
],
},
God: {
extends: 'SuperUser',
defaultDBConnector: { id: 'default' },
dataFields: [
{
path: 'isEvil',
contentType: 'BOOLEAN',
cardinality: 'ONE',
},
],
},
Space: {
idFields: ['id'],
defaultDBConnector: { id: 'default' },
dataFields: [{ ...id }, { ...name, rights: ['CREATE', 'UPDATE'] }],
linkFields: [
{
path: 'users',
cardinality: 'MANY',
relation: 'Space-User',
plays: 'spaces',
target: 'role',
},
{
path: 'objects',
cardinality: 'MANY',
relation: 'SpaceObj',
plays: 'space',
target: 'relation',
},
{
path: 'definitions',
cardinality: 'MANY',
relation: 'SpaceDef',
plays: 'space',
target: 'relation',


Step 2: ⌨️ Coding

  • Modify tests/unit/queries/query.test.ts73cd014
Modify tests/unit/queries/query.test.ts with contents:
• Analyze the existing tests in the `query.test.ts` file and identify the types of queries that are not currently being tested.
• Add new tests for these queries. Each test should create a query, execute it, and then assert that the result is as expected.
• If a test requires data that is not currently in the database, suggest new lines of data to be added to the `data.tql` file.
  • Check tests/unit/queries/query.test.ts
Sandbox logs for
trunk init 1/3 ✓
⡿ Downloading Trunk 1.17.1...
⡿ Downloading Trunk 1.17.1...
⢿ Downloading Trunk 1.17.1...
⣻ Downloading Trunk 1.17.1...
⣽ Downloading Trunk 1.17.1...
⣾ Downloading Trunk 1.17.1...
⣷ Downloading Trunk 1.17.1...
✔ Downloading Trunk 1.17.1... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done


✔ 10 linters were enabled (.trunk/trunk.yaml)
  checkov 3.0.15 (3 json, 2 yaml files)
  eslint 8.52.0 (2 javascript, 51 typescript files)
  git-diff-check (70 files)
  markdownlint 0.37.0 (2 markdown files) (created .markdownlint.yaml)
  prettier 3.0.3 (2 javascript, 3 json, 2 markdown, 1 prettier_supported_configs, 51 typescript, 2 yaml files)
  shellcheck 0.9.0 (1 shell file) (created .shellcheckrc)
  shfmt 3.6.0 (1 shell file)
  trivy 0.46.1 (2 yaml files)
  trufflehog 3.62.1 (70 files)
  yamllint 1.32.0 (2 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt tests/unit/queries/query.test.ts || exit 0 2/3 ✓
 ✔ Formatted tests/unit/queries/query.test.ts
Re-checking autofixed files...


Checked 1 file
✔ No issues
trunk check --fix --print-failures tests/unit/queries/query.test.ts 3/3 ❌ (`1`)
  FAILURES  
 eslint  tests/unit/queries/query.test.ts  .trunk/out/fMjpQ.yaml
 eslint  tests/unit/queries/query.test.ts  .trunk/out/pCrmN.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install`, `yarn install`, or your equivalent      
 thereof                                                                                                                
 Some tools failed to run. You can open the details yaml files for more information.                                    
Checked 1 file
✖ No issues, 2 failures
# .trunk/out/fMjpQ.yaml
trunk_cli_version: 1.17.1
title: eslint exited with exit_code=2
report:
  - eslint exited with exit_code=2
  - suggestion: Eslint could not resolve dependencies; try running `npm install`, `yarn install`, or your equivalent thereof
  - linter:
      command: |
        /root/.cache/trunk/tools/eslint/8.52.0-a618ad632f0aeb358b6d43b1e01c686f/node_modules/.bin/eslint --output-file /tmp/trunk-0/SJv9E3/6jNXiP8FYn5f --format json tests/unit/queries/query.test.ts
      stdin_path: (none)
      run_from: /tmp/trunk-0/mZYuu6/srRoG7
      timeout: 10m
      rerun: (cd /tmp/trunk-0/mZYuu6/srRoG7; env -i PATH=/root/.cache/trunk/tools/eslint/8.52.0-a618ad632f0aeb358b6d43b1e01c686f/node_modules/.bin:/root/.cache/trunk/tools/node/18.12.1-00ae74f39ac4de3ff3c7e3686016ebf3/bin:/root/.cache/trunk/tools/node/18.12.1-00ae74f39ac4de3ff3c7e3686016ebf3:/root/.nvm/versions/node/v18.17.0/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin NODE_PATH=/root/.cache/trunk/tools/eslint/8.52.0-a618ad632f0aeb358b6d43b1e01c686f/node_modules HOME=/root /root/.cache/trunk/tools/eslint/8.52.0-a618ad632f0aeb358b6d43b1e01c686f/node_modules/.bin/eslint --output-file /tmp/trunk-0/SJv9E3/6jNXiP8FYn5f --format json tests/unit/queries/query.test.ts)
      affects_cache:
        - .eslintignore
        - package.json
        - tsconfig.json
      direct_configs:
        - .eslintrc
      exit_status: exited
      exit_code: 2
      stdout: (none)
      stderr: |
        Oops! Something went wrong! :(
        ESLint: 8.52.0
        ESLint couldn't find the config "@blitznocode/eslint-config" to extend from. Please check that the name of the config is correct.
        The config "@blitznocode/eslint-config" was referenced from the config file in "/tmp/trunk-0/mZYuu6/srRoG7/.eslintrc".
        If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.
    parser: |
      (none)
# .trunk/out/pCrmN.yaml
trunk_cli_version: 1.17.1
title: eslint exited with exit_code=2
report:
  - eslint exited with exit_code=2
  - suggestion: Eslint could not resolve dependencies; try running `npm install`, `yarn install`, or your equivalent thereof
  - linter:
      command: |
        /root/.cache/trunk/tools/eslint/8.52.0-a618ad632f0aeb358b6d43b1e01c686f/node_modules/.bin/eslint --output-file /tmp/trunk-0/cg0vKx/qbquk1xNlQZA --format json tests/unit/queries/query.test.ts
      stdin_path: (none)
      run_from: /tmp/trunk-0/CuArlP/HNCUME
      timeout: 10m
      rerun: (cd /tmp/trunk-0/CuArlP/HNCUME; env -i PATH=/root/.cache/trunk/tools/eslint/8.52.0-a618ad632f0aeb358b6d43b1e01c686f/node_modules/.bin:/root/.cache/trunk/tools/node/18.12.1-00ae74f39ac4de3ff3c7e3686016ebf3/bin:/root/.cache/trunk/tools/node/18.12.1-00ae74f39ac4de3ff3c7e3686016ebf3:/root/.nvm/versions/node/v18.17.0/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin NODE_PATH=/root/.cache/trunk/tools/eslint/8.52.0-a618ad632f0aeb358b6d43b1e01c686f/node_modules HOME=/root /root/.cache/trunk/tools/eslint/8.52.0-a618ad632f0aeb358b6d43b1e01c686f/node_modules/.bin/eslint --output-file /tmp/trunk-0/cg0vKx/qbquk1xNlQZA --format json tests/unit/queries/query.test.ts)
      affects_cache:
        - .eslintignore
        - package.json
        - tsconfig.json
      direct_configs:
        - .eslintrc
      exit_status: exited
      exit_code: 2
      stdout: (none)
      stderr: |
        Oops! Something went wrong! :(
        ESLint: 8.52.0
        ESLint couldn't find the config "@blitznocode/eslint-config" to extend from. Please check that the name of the config is correct.
        The config "@blitznocode/eslint-config" was referenced from the config file in "/tmp/trunk-0/CuArlP/HNCUME/.eslintrc".
        If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.
    parser: |
      (none)
  • Modify package.json ! No changes made
Modify package.json with contents: Ensure that the "@blitznocode/eslint-config" package is included in the "devDependencies" section of the package.json file. If it's not present, add it with the appropriate version. After modifying the package.json, run "npm install" or "yarn install" to install the package.
  • Check package.json
Run package.json through the sandbox.
  • Modify .eslintrc ! No changes made
Modify .eslintrc with contents: Check the .eslintrc file to ensure that it's correctly configured to extend from "@blitznocode/eslint-config". The "extends" field in the .eslintrc file should include "@blitznocode/eslint-config". If it's not present, add it.
  • Check .eslintrc
Run .eslintrc through the sandbox.
  • Check tests/unit/queries/query.test.ts
Sandbox logs for
trunk init 1/3 ✓
⡿ Downloading Trunk 1.17.1...
⡿ Downloading Trunk 1.17.1...
⢿ Downloading Trunk 1.17.1...
⣻ Downloading Trunk 1.17.1...
⣽ Downloading Trunk 1.17.1...
⣾ Downloading Trunk 1.17.1...
⣷ Downloading Trunk 1.17.1...
✔ Downloading Trunk 1.17.1... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done


✔ 10 linters were enabled (.trunk/trunk.yaml)
  checkov 3.0.15 (3 json, 2 yaml files)
  eslint 8.52.0 (2 javascript, 51 typescript files)
  git-diff-check (70 files)
  markdownlint 0.37.0 (2 markdown files) (created .markdownlint.yaml)
  prettier 3.0.3 (2 javascript, 3 json, 2 markdown, 1 prettier_supported_configs, 51 typescript, 2 yaml files)
  shellcheck 0.9.0 (1 shell file) (created .shellcheckrc)
  shfmt 3.6.0 (1 shell file)
  trivy 0.46.1 (2 yaml files)
  trufflehog 3.62.1 (70 files)
  yamllint 1.32.0 (2 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt tests/unit/queries/query.test.ts || exit 0 2/3 ✓
 ✔ Formatted tests/unit/queries/query.test.ts
Re-checking autofixed files...


Checked 1 file
✔ No issues
trunk check --fix --print-failures tests/unit/queries/query.test.ts 3/3 ❌ (`1`)
  FAILURES  
 eslint  tests/unit/queries/query.test.ts  .trunk/out/fMjpQ.yaml
 eslint  tests/unit/queries/query.test.ts  .trunk/out/pCrmN.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `npm install`, `yarn install`, or your equivalent      
 thereof                                                                                                                
 Some tools failed to run. You can open the details yaml files for more information.                                    
Checked 1 file
✖ No issues, 2 failures
# .trunk/out/fMjpQ.yaml
trunk_cli_version: 1.17.1
title: eslint exited with exit_code=2
report:
  - eslint exited with exit_code=2
  - suggestion: Eslint could not resolve dependencies; try running `npm install`, `yarn install`, or your equivalent thereof
  - linter:
      command: |
        /root/.cache/trunk/tools/eslint/8.52.0-a618ad632f0aeb358b6d43b1e01c686f/node_modules/.bin/eslint --output-file /tmp/trunk-0/SJv9E3/6jNXiP8FYn5f --format json tests/unit/queries/query.test.ts
      stdin_path: (none)
      run_from: /tmp/trunk-0/mZYuu6/srRoG7
      timeout: 10m
      rerun: (cd /tmp/trunk-0/mZYuu6/srRoG7; env -i PATH=/root/.cache/trunk/tools/eslint/8.52.0-a618ad632f0aeb358b6d43b1e01c686f/node_modules/.bin:/root/.cache/trunk/tools/node/18.12.1-00ae74f39ac4de3ff3c7e3686016ebf3/bin:/root/.cache/trunk/tools/node/18.12.1-00ae74f39ac4de3ff3c7e3686016ebf3:/root/.nvm/versions/node/v18.17.0/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin NODE_PATH=/root/.cache/trunk/tools/eslint/8.52.0-a618ad632f0aeb358b6d43b1e01c686f/node_modules HOME=/root /root/.cache/trunk/tools/eslint/8.52.0-a618ad632f0aeb358b6d43b1e01c686f/node_modules/.bin/eslint --output-file /tmp/trunk-0/SJv9E3/6jNXiP8FYn5f --format json tests/unit/queries/query.test.ts)
      affects_cache:
        - .eslintignore
        - package.json
        - tsconfig.json
      direct_configs:
        - .eslintrc
      exit_status: exited
      exit_code: 2
      stdout: (none)
      stderr: |
        Oops! Something went wrong! :(
        ESLint: 8.52.0
        ESLint couldn't find the config "@blitznocode/eslint-config" to extend from. Please check that the name of the config is correct.
        The config "@blitznocode/eslint-config" was referenced from the config file in "/tmp/trunk-0/mZYuu6/srRoG7/.eslintrc".
        If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.
    parser: |
      (none)
# .trunk/out/pCrmN.yaml
trunk_cli_version: 1.17.1
title: eslint exited with exit_code=2
report:
  - eslint exited with exit_code=2
  - suggestion: Eslint could not resolve dependencies; try running `npm install`, `yarn install`, or your equivalent thereof
  - linter:
      command: |
        /root/.cache/trunk/tools/eslint/8.52.0-a618ad632f0aeb358b6d43b1e01c686f/node_modules/.bin/eslint --output-file /tmp/trunk-0/cg0vKx/qbquk1xNlQZA --format json tests/unit/queries/query.test.ts
      stdin_path: (none)
      run_from: /tmp/trunk-0/CuArlP/HNCUME
      timeout: 10m
      rerun: (cd /tmp/trunk-0/CuArlP/HNCUME; env -i PATH=/root/.cache/trunk/tools/eslint/8.52.0-a618ad632f0aeb358b6d43b1e01c686f/node_modules/.bin:/root/.cache/trunk/tools/node/18.12.1-00ae74f39ac4de3ff3c7e3686016ebf3/bin:/root/.cache/trunk/tools/node/18.12.1-00ae74f39ac4de3ff3c7e3686016ebf3:/root/.nvm/versions/node/v18.17.0/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin NODE_PATH=/root/.cache/trunk/tools/eslint/8.52.0-a618ad632f0aeb358b6d43b1e01c686f/node_modules HOME=/root /root/.cache/trunk/tools/eslint/8.52.0-a618ad632f0aeb358b6d43b1e01c686f/node_modules/.bin/eslint --output-file /tmp/trunk-0/cg0vKx/qbquk1xNlQZA --format json tests/unit/queries/query.test.ts)
      affects_cache:
        - .eslintignore
        - package.json
        - tsconfig.json
      direct_configs:
        - .eslintrc
      exit_status: exited
      exit_code: 2
      stdout: (none)
      stderr: |
        Oops! Something went wrong! :(
        ESLint: 8.52.0
        ESLint couldn't find the config "@blitznocode/eslint-config" to extend from. Please check that the name of the config is correct.
        The config "@blitznocode/eslint-config" was referenced from the config file in "/tmp/trunk-0/CuArlP/HNCUME/.eslintrc".
        If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.
    parser: |
      (none)
  • Modify tests/mocks/data.tqld29d060
Modify tests/mocks/data.tql with contents:
• Based on the new tests added in the `query.test.ts` file, identify if there is a need for additional data in the database.
• If additional data is needed, add new lines of data to the `data.tql` file. The new data should be relevant to the new tests and should help in testing the queries effectively.
  • Check tests/mocks/data.tql
Sandbox logs for
trunk fmt tests/mocks/data.tql || exit 0 1/2 ✓
Found no applicable linters for the requested path
trunk check --fix --print-failures tests/mocks/data.tql 2/2 ✓
Checked 1 file
✔ No issues

Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/add-query-tests.


🎉 Latest improvements to Sweep:

  • Sweep can now passively improve your repository! Check out Rules to learn more.

💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request.
Join Our Discord

@sweep-ai sweep-ai bot mentioned this issue Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant