Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/ci/src/lib/cli/context.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ describe('createCommandContext', () => {
directory: '/test',
logger: console,
monorepo: false,
parallel: false,
nxProjectsFilter: '--with-target={task}',
projects: null,
silent: false,
task: 'code-pushup',
skipComment: false,
},
null,
),
Expand All @@ -38,10 +40,12 @@ describe('createCommandContext', () => {
directory: '/test',
logger: console,
monorepo: false,
parallel: false,
nxProjectsFilter: '--with-target={task}',
projects: null,
silent: false,
task: 'code-pushup',
skipComment: false,
},
{
name: 'ui',
Expand Down
2 changes: 1 addition & 1 deletion packages/ci/src/lib/monorepo/handlers/nx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const nxHandler: MonorepoToolHandler = {
const projects = parseProjects(stdout);
return projects.toSorted().map(project => ({
name: project,
bin: `npx nx run ${project}:${options.task} --`,
bin: `npx nx run ${project}:${options.task} --skip-nx-cache --`,
}));
},

Expand Down
20 changes: 16 additions & 4 deletions packages/ci/src/lib/monorepo/handlers/nx.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,14 @@ describe('nxHandler', () => {

it('should list projects from `nx show projects`', async () => {
await expect(nxHandler.listProjects(options)).resolves.toEqual([
{ name: 'backend', bin: 'npx nx run backend:code-pushup --' },
{ name: 'frontend', bin: 'npx nx run frontend:code-pushup --' },
{
name: 'backend',
bin: 'npx nx run backend:code-pushup --skip-nx-cache --',
},
{
name: 'frontend',
bin: 'npx nx run frontend:code-pushup --skip-nx-cache --',
},
] satisfies ProjectConfig[]);
});

Expand Down Expand Up @@ -119,8 +125,14 @@ describe('nxHandler', () => {
describe('createRunManyCommand', () => {
const projects: MonorepoHandlerProjectsContext = {
all: [
{ name: 'backend', bin: 'npx nx run backend:code-pushup --' },
{ name: 'frontend', bin: 'npx nx run frontend:code-pushup --' },
{
name: 'backend',
bin: 'npx nx run backend:code-pushup --skip-nx-cache --',
},
{
name: 'frontend',
bin: 'npx nx run frontend:code-pushup --skip-nx-cache --',
},
],
};

Expand Down
2 changes: 1 addition & 1 deletion packages/ci/src/lib/monorepo/handlers/turbo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const turboHandler: MonorepoToolHandler = {
.map(({ name, directory }) => ({
name,
directory,
bin: `npx turbo run ${options.task} --`,
bin: `npx turbo run ${options.task} --no-cache --force --`,
}));
}
}
Expand Down
7 changes: 5 additions & 2 deletions packages/ci/src/lib/monorepo/handlers/turbo.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ describe('turboHandler', () => {
{
name: '@example/cli',
directory: path.join(MEMFS_VOLUME, 'packages', 'cli'),
bin: 'npx turbo run code-pushup --',
bin: 'npx turbo run code-pushup --no-cache --force --',
},
{
name: '@example/core',
directory: path.join(MEMFS_VOLUME, 'packages', 'core'),
bin: 'npx turbo run code-pushup --',
bin: 'npx turbo run code-pushup --no-cache --force --',
},
] satisfies ProjectConfig[]);
},
Expand Down Expand Up @@ -171,16 +171,19 @@ describe('turboHandler', () => {
name: 'api',
directory: path.join(MEMFS_VOLUME, 'api'),
bin: 'npx turbo run code-pushup --',
binUncached: 'npx turbo run code-pushup --no-cache --force --',
},
{
name: 'cms',
directory: path.join(MEMFS_VOLUME, 'cms'),
bin: 'npx turbo run code-pushup --',
binUncached: 'npx turbo run code-pushup --no-cache --force --',
},
{
name: 'web',
directory: path.join(MEMFS_VOLUME, 'web'),
bin: 'npx turbo run code-pushup --',
binUncached: 'npx turbo run code-pushup --no-cache --force --',
},
],
};
Expand Down
18 changes: 12 additions & 6 deletions packages/ci/src/lib/monorepo/list-projects.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,14 @@ describe('listMonorepoProjects', () => {
await expect(listMonorepoProjects(MONOREPO_SETTINGS)).resolves.toEqual({
tool: 'nx',
projects: [
{ name: 'backend', bin: 'npx nx run backend:code-pushup --' },
{ name: 'frontend', bin: 'npx nx run frontend:code-pushup --' },
{
name: 'backend',
bin: 'npx nx run backend:code-pushup --skip-nx-cache --',
},
{
name: 'frontend',
bin: 'npx nx run frontend:code-pushup --skip-nx-cache --',
},
],
runManyCommand: expect.any(Function),
} satisfies MonorepoProjects);
Expand Down Expand Up @@ -120,22 +126,22 @@ describe('listMonorepoProjects', () => {
{
name: 'api',
directory: path.join(MEMFS_VOLUME, 'backend', 'api'),
bin: 'npx turbo run code-pushup --',
bin: 'npx turbo run code-pushup --no-cache --force --',
},
{
name: 'auth',
directory: path.join(MEMFS_VOLUME, 'backend', 'auth'),
bin: 'npx turbo run code-pushup --',
bin: 'npx turbo run code-pushup --no-cache --force --',
},
{
name: 'cms',
directory: path.join(MEMFS_VOLUME, 'frontend', 'cms'),
bin: 'npx turbo run code-pushup --',
bin: 'npx turbo run code-pushup --no-cache --force --',
},
{
name: 'web',
directory: path.join(MEMFS_VOLUME, 'frontend', 'web'),
bin: 'npx turbo run code-pushup --',
bin: 'npx turbo run code-pushup --no-cache --force --',
},
],
runManyCommand: expect.any(Function),
Expand Down
4 changes: 2 additions & 2 deletions packages/ci/src/lib/run.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,15 +455,15 @@ describe('runInCI', () => {
name: 'Nx',
tool: 'nx',
run: expect.stringMatching(
/^npx nx run (cli|core|utils):code-pushup --$/,
/^npx nx run (cli|core|utils):code-pushup --skip-nx-cache --$/,
),
runMany:
'npx nx run-many --targets=code-pushup --parallel=false --projects=cli,core,utils --',
},
{
name: 'Turborepo',
tool: 'turbo',
run: 'npx turbo run code-pushup --',
run: 'npx turbo run code-pushup --no-cache --force --',
runMany: 'npx turbo run code-pushup --concurrency=1 --',
},
{
Expand Down
Loading