Skip to content

Commit

Permalink
add integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-olszewski committed Jan 30, 2023
1 parent 28ca025 commit 664038a
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cli/integration_tests/lockfile_aware_caching/berry.t
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ Only b should have a cache miss
Cached: 0 cached, 1 total
Time:\s*[\.0-9]+m?s (re)

Add lockfile changes to a commit
$ git add . && git commit -m "bump lockfile" --quiet
Only root and b should be rebuilt since only the deps for b had a version bump
$ ${TURBO} build --filter="[HEAD^1]" --dry=json | jq ".packages"
[
"//",
"b"
]

Bump of root workspace invalidates all packages
$ patch yarn.lock turbo-bump.patch
Expand All @@ -79,3 +87,12 @@ Bump of root workspace invalidates all packages
Cached: 0 cached, 1 total
Time:\s*[\.0-9]+m?s (re)

Add lockfile changes to a commit
$ git add . && git commit -m "global lockfile change" --quiet
Everything should be rebuilt as a dependency of the root package got bumped
$ ${TURBO} build --filter="[HEAD^1]" --dry=json | jq ".packages | sort"
[
"//",
"a",
"b"
]
17 changes: 17 additions & 0 deletions cli/integration_tests/lockfile_aware_caching/npm.t
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ Only b should have a cache miss
Cached: 0 cached, 1 total
Time:\s*[\.0-9]+m?s (re)

Add lockfile changes to a commit
$ git add . && git commit -m "bump lockfile" --quiet
Only root and b should be rebuilt since only the deps for b had a version bump
$ ${TURBO} build --filter="[HEAD^1]" --dry=json | jq ".packages"
[
"//",
"b"
]

Bump of root workspace invalidates all packages
$ patch package-lock.json turbo-bump.patch
Expand Down Expand Up @@ -103,3 +111,12 @@ Bump of root workspace invalidates all packages
Cached: 0 cached, 1 total
Time:\s*[\.0-9]+m?s (re)

Add lockfile changes to a commit
$ git add . && git commit -m "global lockfile change" --quiet
Everything should be rebuilt as a dependency of the root package got bumped
$ ${TURBO} build --filter="[HEAD^1]" --dry=json | jq ".packages | sort"
[
"//",
"a",
"b"
]
17 changes: 17 additions & 0 deletions cli/integration_tests/lockfile_aware_caching/pnpm.t
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ Only b should have a cache miss
Cached: 0 cached, 1 total
Time:\s*[\.0-9]+m?s (re)

Add lockfile changes to a commit
$ git add . && git commit -m "bump pnpm-lock" --quiet
Only root and b should be rebuilt since only the deps for b had a version bump
$ ${TURBO} build --filter="[HEAD^1]" --dry=json | jq ".packages"
[
"//",
"b"
]

Bump of root workspace invalidates all packages
$ patch pnpm-lock.yaml turbo-bump.patch
Expand Down Expand Up @@ -103,3 +111,12 @@ Bump of root workspace invalidates all packages
Cached: 0 cached, 1 total
Time:\s*[\.0-9]+m?s (re)

Add lockfile changes to a commit
$ git add . && git commit -m "global lockfile change" --quiet
Everything should be rebuilt as a dependency of the root package got bumped
$ ${TURBO} build --filter="[HEAD^1]" --dry=json | jq ".packages | sort"
[
"//",
"a",
"b"
]
2 changes: 2 additions & 0 deletions cli/integration_tests/lockfile_aware_caching/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ git init ${TARGET_DIR} --quiet
GIT_ARGS="--git-dir=${TARGET_DIR}/.git --work-tree=${TARGET_DIR}"
git ${GIT_ARGS} config user.email "turbo-test@example.com"
git ${GIT_ARGS} config user.name "Turbo Test"
echo ".turbo" >> ${TARGET_DIR}/.gitignore
echo "node_modules" >> ${TARGET_DIR}/.gitignore
git ${GIT_ARGS} add .
git ${GIT_ARGS} commit -m "Initial" --quiet

17 changes: 17 additions & 0 deletions cli/integration_tests/lockfile_aware_caching/yarn.t
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ Only b should have a cache miss
Cached: 0 cached, 1 total
Time:\s*[\.0-9]+m?s (re)

Add lockfile changes to a commit
$ git add . && git commit -m "bump lockfile" --quiet
Only root and b should be rebuilt since only the deps for b had a version bump
$ ${TURBO} build --filter="[HEAD^1]" --dry=json | jq ".packages"
[
"//",
"b"
]

Bump of root workspace invalidates all packages
$ patch yarn.lock turbo-bump.patch
Expand Down Expand Up @@ -103,3 +111,12 @@ Bump of root workspace invalidates all packages
Cached: 0 cached, 1 total
Time:\s*[\.0-9]+m?s (re)

Add lockfile changes to a commit
$ git add . && git commit -m "global lockfile change" --quiet
Everything should be rebuilt as a dependency of the root package got bumped
$ ${TURBO} build --filter="[HEAD^1]" --dry=json | jq ".packages | sort"
[
"//",
"a",
"b"
]

0 comments on commit 664038a

Please sign in to comment.