Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up and restructure files #7

Merged
merged 5 commits into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
dist
*.vsix
.taskkey
*.js
!jest.config.js
4 changes: 0 additions & 4 deletions NOTICE

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Trigger Synthetic tests from your Azure pipeline with the [Datadog CI Synthetics

Additional helpful documentation, links, and articles:

- [CI/CD Integrations Configuration][6]
- [CI/CD Integrations Configuration][2]

[1]: https://github.com/DataDog/datadog-ci
[2]: https://docs.datadoghq.com/synthetics/cicd_integrations/configuration
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added datadog-ci/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions jest.config.js → datadog-ci/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
moduleFileExtensions: ['js', 'ts'],
testMatch: ['**/*.test.ts'],
transform: {
'^.+\\.ts$': 'ts-jest'
'^.+\\.ts$': 'ts-jest',
},
verbose: true
}
verbose: true,
}
17 changes: 11 additions & 6 deletions package.json → datadog-ci/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
"main": "lib/task.js",
"scripts": {
"build": "tsc",
"lint": "eslint src/**/*.ts",
"test": "jest"
"lint": "eslint **/*.ts",
"test": "jest",
"prepackage": "yarn install --production",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We must use yarn install --production not only to reduce the VSIX file from 55mb to 25mb but also because without this, we have an fsevents binary file and uploading the file fails because of a wrong MIME type (microsoft/tfs-cli#414).

"package": "cd .. && tfx extension create --manifest-globs vss-extension.json --trace-level debug",
"postpackage": "yarn install"
},
"repository": {
"type": "git",
Expand All @@ -22,21 +25,23 @@
],
"license": "MIT",
"engines": {
"node": "10.24.1"
"node": "10.21.0"
},
"dependencies": {
"@datadog/datadog-ci": "^1.8.0",
"@datadog/datadog-ci": "^1.12.0",
"azure-pipelines-task-lib": "^3.1.1",
"azure-pipelines-tasks-packaging-common": "^2.198.1",
"chalk": "^4.1.2",
"clipanion": "^3.0.1",
"deep-extend": "^0.6.0",
"vss-web-extension-sdk": "^5.141.0"
},
"devDependencies": {
"@types/deep-extend": "^0.4.32",
"@types/jest": "^27.0.2",
"@types/node": "^10.17.0",
"@typescript-eslint/parser": "^4.33.0",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"eslint": "^7.32.0",
"eslint-plugin-jest": "^24.4.2",
"eslint-plugin-prettier": "4.0.0",
Expand All @@ -45,4 +50,4 @@
"ts-jest": "^27.0.7",
"typescript": "4.4.x"
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 4 additions & 3 deletions task/task.json → datadog-ci/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
"Minor": 1,
"Patch": 0
},
"instanceNameFormat": "Query Datadog monitors",
"preview": true,
"instanceNameFormat": "Run Synthetics CI tests",
"inputs": [],
"execution": {
"Node10": {
"target": "../lib/task.js"
"target": "task.js"
}
}
}
}
10 changes: 4 additions & 6 deletions src/task.ts → datadog-ci/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {reportCiError} from './report-ci-error'
import {resolveConfig} from './resolve-config'

async function run(): Promise<void> {
task.setResourcePath(path.join(__dirname, '../task/task.json'))
task.setResourcePath(path.join(__dirname, 'task.json'))

const context: BaseContext = {
stdin: process.stdin,
Expand Down Expand Up @@ -50,8 +50,6 @@ async function run(): Promise<void> {
export const printSummary = (summary: synthetics.Summary): string =>
`criticalErrors: ${summary.criticalErrors}, passed: ${summary.passed}, failedNonBlocking: ${summary.failedNonBlocking}, failed: ${summary.failed}, skipped: ${summary.skipped}, notFound: ${summary.testsNotFound.size}, timedOut: ${summary.timedOut}`

if (require.main === module) {
run()
}

export default run
void run().catch(e => {
console.error('[UNCAUGHT_ERROR]', e)
})
10 changes: 2 additions & 8 deletions tsconfig.json → datadog-ci/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"noImplicitAny": true,
"esModuleInterop": true,
"skipLibCheck": true
},
"exclude": [
"node_modules",
"**/*.test.ts"
]
}
}
}
Loading