-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(core): add unit tests for not connected to nx cloud (nrwl#26885)
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
Showing
12 changed files
with
1,597 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ci-workflow generator circleci pipeline should match snapshot 1`] = ` | ||
exports[`ci-workflow generator connected to nxCloud circleci pipeline should match snapshot 1`] = ` | ||
"version: 2.1 | ||
orbs: | ||
|
@@ -25,6 +25,7 @@ jobs: | |
- nx/set-shas: | ||
main-branch-name: 'main' | ||
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected | ||
- run: ./nx affected --base=$NX_BASE --head=$NX_HEAD -t test build | ||
workflows: | ||
|
@@ -36,7 +37,7 @@ workflows: | |
" | ||
`; | ||
|
||
exports[`ci-workflow generator github pipeline should match snapshot 1`] = ` | ||
exports[`ci-workflow generator connected to nxCloud github pipeline should match snapshot 1`] = ` | ||
"name: CI | ||
on: | ||
|
@@ -74,6 +75,89 @@ jobs: | |
- uses: nrwl/nx-set-shas@v4 | ||
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected | ||
- run: ./nx affected -t test build | ||
" | ||
`; | ||
|
||
exports[`ci-workflow generator not connected to nxCloud circleci pipeline should match snapshot 1`] = ` | ||
"version: 2.1 | ||
orbs: | ||
nx: nrwl/[email protected] | ||
jobs: | ||
main: | ||
environment: | ||
# Configure the JVM and Gradle to avoid OOM errors | ||
_JAVA_OPTIONS: '-Xmx3g' | ||
GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2' | ||
docker: | ||
- image: cimg/openjdk:17.0-node | ||
steps: | ||
- checkout | ||
# This enables task distribution via Nx Cloud | ||
# Run this command as early as possible, before dependencies are installed | ||
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun | ||
# Connect your workspace by running "nx connect" and uncomment this | ||
# - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-jvm" --stop-agents-after="build" | ||
- nx/set-shas: | ||
main-branch-name: 'main' | ||
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected | ||
- run: ./nx affected --base=$NX_BASE --head=$NX_HEAD -t test build | ||
workflows: | ||
version: 2 | ||
ci: | ||
jobs: | ||
- main | ||
" | ||
`; | ||
|
||
exports[`ci-workflow generator not connected to nxCloud github pipeline should match snapshot 1`] = ` | ||
"name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
permissions: | ||
actions: read | ||
contents: read | ||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
# This enables task distribution via Nx Cloud | ||
# Run this command as early as possible, before dependencies are installed | ||
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun | ||
# Connect your workspace by running "nx connect" and uncomment this | ||
# - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-jvm" --stop-agents-after="build" | ||
- name: Set up JDK 17 for x64 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
architecture: x64 | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
- uses: nrwl/nx-set-shas@v4 | ||
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected | ||
- run: ./nx affected -t test build | ||
" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1,600 changes: 1,352 additions & 248 deletions
1,600
packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters