mirror of
https://github.com/codecov/codecov-action.git
synced 2026-02-20 09:51:44 +00:00
fix: update tests
This commit is contained in:
parent
d2ccca2d60
commit
bdd438a538
4 changed files with 26 additions and 10 deletions
6
dist/index.js
vendored
6
dist/index.js
vendored
|
|
@ -32286,7 +32286,7 @@ const buildCommitExec = () => {
|
||||||
if (commitParent) {
|
if (commitParent) {
|
||||||
commitExecArgs.push('--parent-sha', `${commitParent}`);
|
commitExecArgs.push('--parent-sha', `${commitParent}`);
|
||||||
}
|
}
|
||||||
commitExecArgs.push(`--git-service ${gitService ? gitService : 'github'}`);
|
commitExecArgs.push('--git-service', `${gitService ? gitService : 'github'}`);
|
||||||
if (overrideBranch) {
|
if (overrideBranch) {
|
||||||
commitExecArgs.push('-B', `${overrideBranch}`);
|
commitExecArgs.push('-B', `${overrideBranch}`);
|
||||||
}
|
}
|
||||||
|
|
@ -32352,7 +32352,7 @@ const buildReportExec = () => {
|
||||||
if (token) {
|
if (token) {
|
||||||
reportOptions.env.CODECOV_TOKEN = token;
|
reportOptions.env.CODECOV_TOKEN = token;
|
||||||
}
|
}
|
||||||
reportExecArgs.push(`--git-service ${gitService ? gitService : 'github'}`);
|
reportExecArgs.push('--git-service', `${gitService ? gitService : 'github'}`);
|
||||||
if (overrideCommit) {
|
if (overrideCommit) {
|
||||||
reportExecArgs.push('-C', `${overrideCommit}`);
|
reportExecArgs.push('-C', `${overrideCommit}`);
|
||||||
}
|
}
|
||||||
|
|
@ -32460,7 +32460,7 @@ const buildUploadExec = () => {
|
||||||
uploadExecArgs.push('-F', `${f}`);
|
uploadExecArgs.push('-F', `${f}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
uploadExecArgs.push(`--git-service ${gitService ? gitService : 'github'}`);
|
uploadExecArgs.push('--git-service', `${gitService ? gitService : 'github'}`);
|
||||||
if (handleNoReportsFound) {
|
if (handleNoReportsFound) {
|
||||||
uploadExecArgs.push('--handle-no-reports-found');
|
uploadExecArgs.push('--handle-no-reports-found');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
|
@ -38,7 +38,10 @@ test('general args', () => {
|
||||||
|
|
||||||
|
|
||||||
test('upload args using context', () => {
|
test('upload args using context', () => {
|
||||||
const expectedArgs = [];
|
const expectedArgs = [
|
||||||
|
'--git-service',
|
||||||
|
'github',
|
||||||
|
];
|
||||||
const {uploadExecArgs, uploadCommand} = buildUploadExec();
|
const {uploadExecArgs, uploadCommand} = buildUploadExec();
|
||||||
if (context.eventName == 'pull_request') {
|
if (context.eventName == 'pull_request') {
|
||||||
expectedArgs.push('-C', `${context.payload.pull_request.head.sha}`);
|
expectedArgs.push('-C', `${context.payload.pull_request.head.sha}`);
|
||||||
|
|
@ -110,6 +113,8 @@ test('upload args', () => {
|
||||||
'test',
|
'test',
|
||||||
'-F',
|
'-F',
|
||||||
'test2',
|
'test2',
|
||||||
|
'--git-service',
|
||||||
|
'github',
|
||||||
'--handle-no-reports-found',
|
'--handle-no-reports-found',
|
||||||
'--job-code',
|
'--job-code',
|
||||||
'32',
|
'32',
|
||||||
|
|
@ -165,6 +170,8 @@ test('report args', () => {
|
||||||
const {reportExecArgs, reportCommand} = buildReportExec();
|
const {reportExecArgs, reportCommand} = buildReportExec();
|
||||||
|
|
||||||
const expectedArgs = [
|
const expectedArgs = [
|
||||||
|
'--git-service',
|
||||||
|
'github',
|
||||||
'-C',
|
'-C',
|
||||||
'9caabca5474b49de74ef5667deabaf74cdacc244',
|
'9caabca5474b49de74ef5667deabaf74cdacc244',
|
||||||
'-P',
|
'-P',
|
||||||
|
|
@ -189,7 +196,10 @@ test('report args using context', () => {
|
||||||
for (const env of Object.keys(envs)) {
|
for (const env of Object.keys(envs)) {
|
||||||
process.env['INPUT_' + env.toUpperCase()] = envs[env];
|
process.env['INPUT_' + env.toUpperCase()] = envs[env];
|
||||||
}
|
}
|
||||||
const expectedArgs : string[] = [];
|
const expectedArgs : string[] = [
|
||||||
|
'--git-service',
|
||||||
|
'github',
|
||||||
|
];
|
||||||
if (context.eventName == 'pull_request') {
|
if (context.eventName == 'pull_request') {
|
||||||
expectedArgs.push('-C', `${context.payload.pull_request.head.sha}`);
|
expectedArgs.push('-C', `${context.payload.pull_request.head.sha}`);
|
||||||
}
|
}
|
||||||
|
|
@ -206,6 +216,7 @@ test('report args using context', () => {
|
||||||
|
|
||||||
test('commit args', () => {
|
test('commit args', () => {
|
||||||
const envs = {
|
const envs = {
|
||||||
|
git_service: 'github_enterprise',
|
||||||
commit_parent: '83231650328f11695dfb754ca0f540516f188d27',
|
commit_parent: '83231650328f11695dfb754ca0f540516f188d27',
|
||||||
override_branch: 'thomasrockhu/test',
|
override_branch: 'thomasrockhu/test',
|
||||||
override_commit: '9caabca5474b49de74ef5667deabaf74cdacc244',
|
override_commit: '9caabca5474b49de74ef5667deabaf74cdacc244',
|
||||||
|
|
@ -222,6 +233,8 @@ test('commit args', () => {
|
||||||
const expectedArgs = [
|
const expectedArgs = [
|
||||||
'--parent-sha',
|
'--parent-sha',
|
||||||
'83231650328f11695dfb754ca0f540516f188d27',
|
'83231650328f11695dfb754ca0f540516f188d27',
|
||||||
|
'--git-service',
|
||||||
|
'github_enterprise',
|
||||||
'-B',
|
'-B',
|
||||||
'thomasrockhu/test',
|
'thomasrockhu/test',
|
||||||
'-C',
|
'-C',
|
||||||
|
|
@ -241,7 +254,10 @@ test('commit args', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('commit args using context', () => {
|
test('commit args using context', () => {
|
||||||
const expectedArgs :string[] = [];
|
const expectedArgs :string[] = [
|
||||||
|
'--git-service',
|
||||||
|
'github',
|
||||||
|
];
|
||||||
|
|
||||||
const {commitExecArgs, commitCommand} = buildCommitExec();
|
const {commitExecArgs, commitCommand} = buildCommitExec();
|
||||||
if (context.eventName == 'pull_request') {
|
if (context.eventName == 'pull_request') {
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ const buildCommitExec = () => {
|
||||||
if (commitParent) {
|
if (commitParent) {
|
||||||
commitExecArgs.push('--parent-sha', `${commitParent}`);
|
commitExecArgs.push('--parent-sha', `${commitParent}`);
|
||||||
}
|
}
|
||||||
commitExecArgs.push(`--git-service ${gitService ? gitService : 'github'}`);
|
commitExecArgs.push('--git-service', `${gitService ? gitService : 'github'}`);
|
||||||
|
|
||||||
if (overrideBranch) {
|
if (overrideBranch) {
|
||||||
commitExecArgs.push('-B', `${overrideBranch}`);
|
commitExecArgs.push('-B', `${overrideBranch}`);
|
||||||
|
|
@ -128,7 +128,7 @@ const buildReportExec = () => {
|
||||||
if (token) {
|
if (token) {
|
||||||
reportOptions.env.CODECOV_TOKEN = token;
|
reportOptions.env.CODECOV_TOKEN = token;
|
||||||
}
|
}
|
||||||
reportExecArgs.push(`--git-service ${gitService ? gitService : 'github'}`);
|
reportExecArgs.push('--git-service', `${gitService ? gitService : 'github'}`);
|
||||||
|
|
||||||
if (overrideCommit) {
|
if (overrideCommit) {
|
||||||
reportExecArgs.push('-C', `${overrideCommit}`);
|
reportExecArgs.push('-C', `${overrideCommit}`);
|
||||||
|
|
@ -245,7 +245,7 @@ const buildUploadExec = () => {
|
||||||
uploadExecArgs.push('-F', `${f}`);
|
uploadExecArgs.push('-F', `${f}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
uploadExecArgs.push(`--git-service ${gitService ? gitService : 'github'}`);
|
uploadExecArgs.push('--git-service', `${gitService ? gitService : 'github'}`);
|
||||||
if (handleNoReportsFound) {
|
if (handleNoReportsFound) {
|
||||||
uploadExecArgs.push('--handle-no-reports-found');
|
uploadExecArgs.push('--handle-no-reports-found');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue