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

Add more query tests #27

Closed
wants to merge 55 commits into from
Closed

Add more query tests #27

wants to merge 55 commits into from

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Nov 1, 2023

PR Feedback: 👎

Description

This PR adds more query tests to the Blitz-orm project. The existing tests in the query.test.ts file were analyzed to identify the types of queries that were not covered. New tests were added for these queries to ensure comprehensive test coverage. The testSchema.ts file was used to define the schema and the data.tql file was used to provide the necessary data for the tests.

Summary of Changes

  • Added new tests for queries in the query.test.ts file to cover types of queries that were not previously tested.
  • Modified the data.tql file to include additional data that was needed for the new tests.

Please review and merge this PR to enhance the test coverage for the Blitz-orm project.

Fixes #26.


🎉 Latest improvements to Sweep:

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

💡 To get Sweep to edit this pull request, you can:

  • Comment below, and Sweep can edit the entire PR
  • Comment on a file, Sweep will only modify the commented file
  • Edit the original issue to get Sweep to recreate the PR from scratch

Copy link
Contributor Author

sweep-ai bot commented Nov 1, 2023

Sandbox Executions

  • 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)
  • Check package.json
Run package.json through the sandbox.
  • 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)
  • 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

Copy link
Contributor Author

sweep-ai bot commented Nov 1, 2023

Apply Sweep Rules to your PR?

  • Apply: Leftover TODOs in the code should be handled.
  • Apply: All new business logic should have corresponding unit tests in the tests/ directory.
  • Apply: Any clearly inefficient or repeated code should be optimized or refactored.

@sweep-ai sweep-ai bot added the sweep label Nov 1, 2023
@sweep-ai sweep-ai bot mentioned this pull request Nov 1, 2023
7 tasks
@lveillard lveillard closed this Jun 3, 2024
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 this pull request may close these issues.

Sweep: Add more query tests
1 participant