Skip to content

Commit

Permalink
Adding some testing
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasLYang committed Sep 17, 2024
1 parent 769fe82 commit da14f3e
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 9 deletions.
2 changes: 2 additions & 0 deletions crates/turborepo-lib/src/query/file.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::sync::Arc;

use async_graphql::Object;
use itertools::Itertools;
use turbo_trace::Tracer;
use turbopath::AbsoluteSystemPathBuf;

Expand Down Expand Up @@ -51,6 +52,7 @@ impl File {
.files
.into_iter()
.map(|path| File::new(self.run.clone(), path))
.sorted_by(|a, b| a.path.cmp(&b.path))
.collect())
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
{
"name": "create_turbo",
"private": true,
"scripts": {
"build": "turbo build",
"dev": "turbo dev",
"lint": "turbo lint",
"format": "prettier --write \"**/*.{ts,tsx,md}\""
},
"devDependencies": {
"prettier": "^3.2.5",
"turbo": "^2.1.2",
"typescript": "^5.4.5"
},
"engines": {
"node": ">=18"
},
"packageManager": "npm@10.2.4",
"workspaces": [
"apps/*",
"packages/*"
Expand Down
2 changes: 1 addition & 1 deletion turborepo-tests/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "turborepo-tests-integration",
"scripts": {
"test": "prysk tests",
"test:interactive": "prysk --interactive tests",
"test:interactive": "PRYSK_INTERACTIVE=true prysk tests",
"test:parallel": ".cram_env/bin/pytest -n auto tests --prysk-shell=`which bash`",
"pretest:parallel": ".cram_env/bin/pip3 install --quiet pytest \"prysk[pytest-plugin]\" pytest-xdist"
},
Expand Down
60 changes: 60 additions & 0 deletions turborepo-tests/integration/tests/turbo-trace.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh create_turbo "npm@8.19.4"

$ ${TURBO} query "query { file(path: \"apps/docs/app/page.tsx\") { path } }"
WARNING query command is experimental and may change in the future
{
"data": {
"file": {
"path": "apps/docs/app/page.tsx"
}
}
}
$ ${TURBO} query "query { file(path: \"apps/docs/app/page.tsx\") { path, dependencies { path } } }"
WARNING query command is experimental and may change in the future
{
"data": {
"file": {
"path": "apps/docs/app/page.tsx",
"dependencies": [
{
"path": "apps/docs/app/page.tsx"
},
{
"path": "node_modules/next/image.js"
},
{
"path": "node_modules/react/index.js"
},
{
"path": "packages/ui/src/button.tsx"
}
]
}
}
}
$ ${TURBO} query "query { file(path: \"apps/web/app/page.tsx\") { path, dependencies { path } } }"
WARNING query command is experimental and may change in the future
{
"data": {
"file": {
"path": "apps/web/app/page.tsx",
"dependencies": [
{
"path": "apps/web/app/page.tsx"
},
{
"path": "node_modules/next/image.js"
},
{
"path": "node_modules/react/index.js"
},
{
"path": "packages/ui/src/button.tsx"
}
]
}
}
}

0 comments on commit da14f3e

Please sign in to comment.