Skip to content

Commit

Permalink
Simplify workaround that overrides Jest clone folder on Azure Pipelin…
Browse files Browse the repository at this point in the history
…es (#8413)
  • Loading branch information
willsmythe authored and jeysal committed May 2, 2019
1 parent 1c5d830 commit b870306
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
16 changes: 3 additions & 13 deletions .azure-pipelines-steps.yml
Expand Up @@ -2,9 +2,9 @@
# Steps for building and testing Jest. See jobs defined in .azure-pipelines.yml
#

# Clones the repo
steps:
- checkout: self
path: jest

# Ensure Node.js 10 is active
- task: NodeTool@0
Expand All @@ -18,34 +18,24 @@ steps:
versionSpec: '2.7'
displayName: 'Use Python 2.7'

# Workaround to move source files under a "jest" folder (see .azure-pipelines.yml for details)
- script: |
cd /
mv $(Build.Repository.LocalPath) $(JEST_DIR)
mkdir $(Build.Repository.LocalPath)
displayName: 'Move source into jest folder'
# Run yarn to install dependencies and build
- script: node scripts/remove-postinstall
workingDirectory: $(JEST_DIR)
displayName: 'Remove postinstall script'

- script: yarn --no-progress --frozen-lockfile
workingDirectory: $(JEST_DIR)
displayName: 'Install dependencies'

- script: node scripts/build
workingDirectory: $(JEST_DIR)
displayName: 'Build'

# Run test-ci-partial
- script: yarn run test-ci-partial
workingDirectory: $(JEST_DIR)
displayName: 'Run tests'

# Publish CI test results
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/reports/junit/*.xml'
searchFolder: $(JEST_DIR)
testRunTitle: 'CI Tests $(Agent.OS)'
displayName: 'Publish test results'
condition: succeededOrFailed()
4 changes: 0 additions & 4 deletions .azure-pipelines.yml
Expand Up @@ -32,9 +32,5 @@ variables:
# Used by chalk. Ensures output from Jest includes ANSI escape characters that are needed to match test snapshots.
FORCE_COLOR: 1

# By default, Azure Pipelines clones to an "s" directory, which causes tests to fail due to assumption of Jest being run from a "jest" directory.
# See packages/jest-message-util/src/index.js PATH_JEST_PACKAGES for more details.
JEST_DIR: $(Agent.BuildDirectory)/jest

# Ensures the handful of tests that should be skipped during CI are
CI: true

0 comments on commit b870306

Please sign in to comment.