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

chore(repo): disable e2e test with escaping issues on windows #10333

Merged
merged 1 commit into from
May 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
52 changes: 28 additions & 24 deletions e2e/cli/src/cli.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
isNotWindows,
newProject,
readFile,
readJson,
Expand Down Expand Up @@ -344,33 +345,36 @@ describe('migrate', () => {
});

it('should run migrations and create individual git commits using a provided custom commit prefix', () => {
runCLI(
'migrate migrate-parent-package@2.0.0 --from="migrate-parent-package@1.0.0"',
{
env: {
...process.env,
NX_MIGRATE_SKIP_INSTALL: 'true',
NX_MIGRATE_USE_LOCAL: 'true',
},
}
);
// Windows has shell escaping issues so this test would always fail
if (isNotWindows()) {
runCLI(
'migrate migrate-parent-package@2.0.0 --from="migrate-parent-package@1.0.0"',
{
env: {
...process.env,
NX_MIGRATE_SKIP_INSTALL: 'true',
NX_MIGRATE_USE_LOCAL: 'true',
},
}
);

// runs migrations with createCommits enabled and custom commit-prefix (NOTE: the extra quotes are needed here to avoid shell escaping issues)
runCLI(
`migrate --run-migrations=migrations.json --create-commits --commit-prefix="'chore(core): AUTOMATED - '"`,
{
env: {
...process.env,
NX_MIGRATE_SKIP_INSTALL: 'true',
NX_MIGRATE_USE_LOCAL: 'true',
},
}
);
// runs migrations with createCommits enabled and custom commit-prefix (NOTE: the extra quotes are needed here to avoid shell escaping issues)
runCLI(
`migrate --run-migrations=migrations.json --create-commits --commit-prefix="'chore(core): AUTOMATED - '"`,
{
env: {
...process.env,
NX_MIGRATE_SKIP_INSTALL: 'true',
NX_MIGRATE_USE_LOCAL: 'true',
},
}
);

const recentCommits = runCommand('git --no-pager log --oneline -n 10');
const recentCommits = runCommand('git --no-pager log --oneline -n 10');

expect(recentCommits).toContain('chore(core): AUTOMATED - run11');
expect(recentCommits).toContain('chore(core): AUTOMATED - run20');
expect(recentCommits).toContain('chore(core): AUTOMATED - run11');
expect(recentCommits).toContain('chore(core): AUTOMATED - run20');
}
});

it('should fail if a custom commit prefix is provided when --create-commits is not enabled', () => {
Expand Down