Skip to content

Commit

Permalink
fixing more test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardfoyle committed Apr 4, 2024
1 parent 5d95f0a commit 91c949c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
8 changes: 5 additions & 3 deletions scripts/components/release_lifecycle_manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ void describe('ReleaseLifecycleManager', async () => {
const runPublishInTestDir = () =>
runPublish({ useLocalRegistry: true }, testWorkingDir);

const packageABaseName = `${testNameNormalized}-packageA-${shortId}`;
const packageBBaseName = `${testNameNormalized}-packageB-${shortId}`;
// converting to lowercase because npm init creates packages with all lowercase
const packageABaseName =
`${testNameNormalized}-package-a-${shortId}`.toLocaleLowerCase();
const packageBBaseName =
`${testNameNormalized}-package-b-${shortId}`.toLocaleLowerCase();

await gitClient.init();
await npmClient.init();
Expand All @@ -69,7 +72,6 @@ void describe('ReleaseLifecycleManager', async () => {
await $`npx changeset init`;
await gitClient.commitAllChanges('initial commit');
await runPublishInTestDir();
await runPublishInTestDir();

await commitVersionBumpChangeset(
testWorkingDir,
Expand Down
14 changes: 10 additions & 4 deletions scripts/version_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@ export const runVersion = async (

// taking inspiration from https://github.com/changesets/changesets/pull/1045/files
// we fetch all refs so that changesets doesn't go into the shallow clone codepath
await execa('git', ['fetch', '--unshallow', '--no-tags'], {
stdio: 'inherit',
cwd,
});
try {
await execa('git', ['fetch', '--unshallow', '--no-tags'], {
stdio: 'inherit',
cwd,
});
} catch (err) {
console.log(
'git fetch --unshallow failed. This likely means we already have an un-shallow repo'
);
}

const args = ['version', ...additionalArgs];
await execa('changeset', args, {
Expand Down

0 comments on commit 91c949c

Please sign in to comment.