chore(repo): add packages to e2e-release and explicit error for flakiness (#20740)

This commit is contained in:
James Henry 2023-12-13 20:55:46 +04:00 committed by GitHub
parent dba679ec47
commit a30888b92e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 5 deletions

View File

@ -49,6 +49,7 @@ describe('nx release - independent projects', () => {
beforeAll(() => { beforeAll(() => {
newProject({ newProject({
unsetProjectNameAndRootFormat: false, unsetProjectNameAndRootFormat: false,
packages: ['@nx/js'],
}); });
pkg1 = uniq('my-pkg-1'); pkg1 = uniq('my-pkg-1');

View File

@ -48,6 +48,7 @@ describe('nx release - private JS packages', () => {
beforeAll(() => { beforeAll(() => {
newProject({ newProject({
unsetProjectNameAndRootFormat: false, unsetProjectNameAndRootFormat: false,
packages: ['@nx/js'],
}); });
publicPkg1 = uniq('public-pkg-1'); publicPkg1 = uniq('public-pkg-1');

View File

@ -50,6 +50,7 @@ describe('nx release', () => {
beforeAll(() => { beforeAll(() => {
newProject({ newProject({
unsetProjectNameAndRootFormat: false, unsetProjectNameAndRootFormat: false,
packages: ['@nx/js'],
}); });
pkg1 = uniq('my-pkg-1'); pkg1 = uniq('my-pkg-1');
@ -111,11 +112,26 @@ describe('nx release', () => {
).toEqual(3); ).toEqual(3);
// Only one dependency relationship exists, so this log should only match once // Only one dependency relationship exists, so this log should only match once
expect( const dependencyRelationshipLogMatch = versionOutput.match(
versionOutput.match( /Applying new version 999.9.9 to 1 package which depends on my-pkg-\d*/g
/Applying new version 999.9.9 to 1 package which depends on my-pkg-\d*/g );
).length if (
).toEqual(1); !dependencyRelationshipLogMatch ||
dependencyRelationshipLogMatch.length !== 1
) {
// From JamesHenry: explicit error to assist troubleshooting NXC-143
throw new Error(
`
Error: Expected to find exactly one dependency relationship log line.
If you are seeing this message then you have been impacted by some currently undiagnosed flakiness in the test.
Please report the full nx release version command output below to the Nx team:
${versionOutput}`
);
}
expect(dependencyRelationshipLogMatch.length).toEqual(1);
// Generate a changelog for the new version // Generate a changelog for the new version
expect(exists('CHANGELOG.md')).toEqual(false); expect(exists('CHANGELOG.md')).toEqual(false);