MCPcopy Index your code
hub / github.com/serverless/serverless / findTestFile

Function findTestFile

packages/serverless/lib/plugins/python/lib/docker.js:63–81  ·  view source on GitHub ↗

* Find a file that exists on all projects so we can test if Docker can see it too * @param {string} servicePath * @return {string} file name

(servicePath, pluginInstance)

Source from the content-addressed store, hash-verified

61 * @return {string} file name
62 */
63function findTestFile(servicePath, pluginInstance) {
64 if (fse.pathExistsSync(path.join(servicePath, 'serverless.yml'))) {
65 return 'serverless.yml'
66 }
67 if (fse.pathExistsSync(path.join(servicePath, 'serverless.yaml'))) {
68 return 'serverless.yaml'
69 }
70 if (fse.pathExistsSync(path.join(servicePath, 'serverless.json'))) {
71 return 'serverless.json'
72 }
73 if (fse.pathExistsSync(path.join(servicePath, 'requirements.txt'))) {
74 return 'requirements.txt'
75 }
76 throw new ServerlessError(
77 'Unable to find serverless.{yml|yaml|json} or requirements.txt for getBindPath()',
78 'PYTHON_REQUIREMENTS_MISSING_GET_BIND_PATH_FILE',
79 { stack: false },
80 )
81}
82
83/**
84 * Test bind path to make sure it's working

Callers 1

getBindPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…