Skip to content

Commit

Permalink
ci: fix path issue for perf test (#657)
Browse files Browse the repository at this point in the history
  • Loading branch information
scolladon authored Jul 24, 2023
1 parent 3145e45 commit a4117af
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 77 deletions.
9 changes: 8 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ Happy linting! 💖
*/
module.exports = {
extends: ['eslint:recommended', 'plugin:prettier/recommended', 'prettier'],
ignorePatterns: ['lib/**/*', 'node_modules', '.next', 'output', 'reports'],
ignorePatterns: [
'lib/**/*',
'node_modules',
'.next',
'output',
'reports',
'e2e',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
Expand Down
3 changes: 1 addition & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# These are supported funding model platforms

---
github: [scolladon]
24 changes: 9 additions & 15 deletions .github/workflows/on-main-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,28 +85,19 @@ jobs:
yarn test:e2e
perf:
needs: build
needs: prepare-release
runs-on: ubuntu-latest
if: needs.prepare-release.outputs.release_created == 'false'
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
path: ./plugin

- name: Checkout sources
uses: actions/checkout@v3
with:
ref: 'e2e/head'
fetch-depth: 0
path: ./sgd-e2e

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Get yarn cache directory path
working-directory: ./plugin
id: yarn-cache-dir-path
run: echo "yarn-cache=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
shell: bash
Expand All @@ -117,25 +108,28 @@ jobs:
key: ${{ runner.os }}-16-yarn-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
working-directory: ./plugin
run: yarn install --immutable --check-cache

- name: Build plugin
working-directory: ./plugin
run: yarn pack

- name: Install sfdx-cli
run: npm install -g sfdx-cli

- name: Install plugin
working-directory: ./plugin
run: |
yarn set version classic
sfdx plugins:link .
sfdx plugins
- name: Checkout e2e sources
uses: actions/checkout@v3
with:
ref: 'e2e/head'
fetch-depth: 0
path: ./e2e

- name: Run benchmark
working-directory: ./plugin
run: yarn test:perf

- name: Store benchmark result
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/e2e
/node_modules
/reports
/lib
Expand All @@ -10,6 +11,7 @@ sfdx-git-delta-*.tgz
package.tgz
stderr*.txt
stdout*.txt
perf-result.txt
# stryker temp files
.stryker-tmp

Expand Down
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
nodeLinker: node-modules

npmPublishRegistry: "https://registry.npmjs.org/"
Expand Down
2 changes: 1 addition & 1 deletion __tests__/perf/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const suite = new Benchmark.Suite()
suite
.add('e2e-test', () => {
execCmd(
'sgd:source:delta --from "origin/e2e/base" --to "origin/e2e/head" --output ../sgd-e2e/expected --generate-delta --repo ../sgd-e2e',
'sgd:source:delta --from "origin/e2e/base" --to "origin/e2e/head" --output e2e/expected --generate-delta --repo e2e',
{
ensureExitCode: 0,
}
Expand Down
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ module.exports = {
'/node_modules/',
'/__tests__/__utils__/',
'/reports/',
'/e2e',
],

// The regexp pattern or array of patterns that Jest uses to detect test files
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@
"@commitlint/cli": "^17.6.7",
"@commitlint/config-conventional": "^17.6.7",
"@oclif/dev-cli": "^1.26.10",
"@salesforce/cli-plugins-testkit": "^4.2.6",
"@salesforce/cli-plugins-testkit": "^4.2.7",
"@salesforce/dev-config": "^4.0.1",
"@salesforce/ts-sinon": "^1.4.12",
"@stryker-mutator/core": "^7.1.1",
"@stryker-mutator/jest-runner": "^7.1.1",
"@swc/core": "^1.3.70",
"@types/mocha": "^10.0.1",
"@types/node": "^20.4.2",
"@types/node": "^20.4.4",
"@typescript-eslint/parser": "^6.1.0",
"benchmark": "^2.1.4",
"chai": "^4.3.7",
Expand Down
2 changes: 1 addition & 1 deletion stryker.conf.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const config = {
testRunner: 'jest',
coverageAnalysis: 'perTest',
ignoreStatic: true,
ignorePatterns: ['lib/', 'reports/', 'bin/'],
ignorePatterns: ['lib/', 'reports/', 'bin/', 'e2e'],
mutate: ['src/**/*.js'],
}
export default config
6 changes: 3 additions & 3 deletions tooling/incrementApiVersion.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

filename=`find src/metadata -type f -name "v*.json" | sort | tail -1`
version=`echo "$filename" | tr -d -c 0-9`
filename=$(find src/metadata -type f -name "v*.json" | sort | tail -1)
version=$(echo "$filename" | tr -d -c 0-9)
((version++))
targetname="src/metadata/v${version}.json"
\cp "$filename" "$targetname"
\cp "$filename" "$targetname"
Loading

0 comments on commit a4117af

Please sign in to comment.