Skip to content

Commit

Permalink
Fix imports
Browse files Browse the repository at this point in the history
Fixed imports after the refactor of utils

See: #13604
  • Loading branch information
radoslawkrzemien committed Jun 30, 2023
1 parent 6dfa60b commit 1ebc0d1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
7 changes: 4 additions & 3 deletions workflow_tests/platformDeploy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const kieMockGithub = require('@kie/mock-github');
const utils = require('./utils/utils');
const assertions = require('./assertions/platformDeployAssertions');
const mocks = require('./mocks/platformDeployMocks');
const eAct = require('./utils/ExtendedAct');

let mockGithub;
const FILES_TO_COPY_INTO_TEST_REPO = [
Expand Down Expand Up @@ -48,7 +49,7 @@ describe('test workflow platformDeploy', () => {
test('as team member - platform deploy executes on staging', async () => {
const repoPath = mockGithub.repo.getPath('testPlatformDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'platformDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down Expand Up @@ -120,7 +121,7 @@ describe('test workflow platformDeploy', () => {
test('as OSBotify - platform deploy executes on staging', async () => {
const repoPath = mockGithub.repo.getPath('testPlatformDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'platformDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down Expand Up @@ -192,7 +193,7 @@ describe('test workflow platformDeploy', () => {
test('as outsider - platform deploy does not execute', async () => {
const repoPath = mockGithub.repo.getPath('testPlatformDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'platformDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down
39 changes: 20 additions & 19 deletions workflow_tests/preDeploy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const kieMockGithub = require('@kie/mock-github');
const utils = require('./utils/utils');
const assertions = require('./assertions/preDeployAssertions');
const mocks = require('./mocks/preDeployMocks');
const eAct = require('./utils/ExtendedAct');

let mockGithub;
const FILES_TO_COPY_INTO_TEST_REPO = [
Expand Down Expand Up @@ -51,7 +52,7 @@ describe('test workflow preDeploy', () => {
const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');

// instantiate Act in the context of the test repo and given workflow file
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);

// set run parameters
act = utils.setUpActParams(
Expand Down Expand Up @@ -102,7 +103,7 @@ describe('test workflow preDeploy', () => {
// test('push to different branch - workflow does not execute', async () => {
// const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || '';
// const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');
// let act = new utils.ExtendedAct(repoPath, workflowPath);
// let act = new eAct.ExtendedAct(repoPath, workflowPath);
// act = utils.setUpActParams(
// act,
// 'push',
Expand Down Expand Up @@ -145,7 +146,7 @@ describe('test workflow preDeploy', () => {
test('different event than push - workflow does not execute', async () => {
const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
const testMockSteps = {
lint: mocks.LINT_JOB_MOCK_STEPS,
test: mocks.TEST_JOB_MOCK_STEPS,
Expand Down Expand Up @@ -214,7 +215,7 @@ describe('test workflow preDeploy', () => {
test('lint job failed - workflow exits', async () => {
const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down Expand Up @@ -293,7 +294,7 @@ describe('test workflow preDeploy', () => {
test('test job failed - workflow exits', async () => {
const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down Expand Up @@ -372,7 +373,7 @@ describe('test workflow preDeploy', () => {
test('lint and test job succeed - workflow continues', async () => {
const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down Expand Up @@ -415,7 +416,7 @@ describe('test workflow preDeploy', () => {
test('actor is OSBotify - no comment left', async () => {
const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down Expand Up @@ -454,7 +455,7 @@ describe('test workflow preDeploy', () => {
test('actor is Expensify employee - no comment left', async () => {
const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down Expand Up @@ -493,7 +494,7 @@ describe('test workflow preDeploy', () => {
test('actor is not Expensify employee, its not their first PR - job triggers, but no comment left', async () => {
const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down Expand Up @@ -532,7 +533,7 @@ describe('test workflow preDeploy', () => {
test('actor is not Expensify employee, and its their first PR - job triggers and comment left', async () => {
const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down Expand Up @@ -575,7 +576,7 @@ describe('test workflow preDeploy', () => {
test('not automated PR - deploy skipped and comment left', async () => {
const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down Expand Up @@ -615,7 +616,7 @@ describe('test workflow preDeploy', () => {
test('automated PR - deploy skipped, but no comment left', async () => {
const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down Expand Up @@ -657,7 +658,7 @@ describe('test workflow preDeploy', () => {
test('not automated PR - proceed with deploy', async () => {
const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down Expand Up @@ -701,7 +702,7 @@ describe('test workflow preDeploy', () => {
test('automated PR - deploy skipped, but no comment left', async () => {
const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down Expand Up @@ -748,7 +749,7 @@ describe('test workflow preDeploy', () => {
test('not automated PR - proceed with deploy', async () => {
const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down Expand Up @@ -792,7 +793,7 @@ describe('test workflow preDeploy', () => {
test('automated PR - proceed with deploy', async () => {
const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down Expand Up @@ -838,7 +839,7 @@ describe('test workflow preDeploy', () => {
test('not automated PR - proceed with deploy', async () => {
const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down Expand Up @@ -882,7 +883,7 @@ describe('test workflow preDeploy', () => {
test('automated PR - proceed with deploy', async () => {
const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down Expand Up @@ -928,7 +929,7 @@ describe('test workflow preDeploy', () => {
test('one of updateStaging steps failed - failure announced in Slack', async () => {
const repoPath = mockGithub.repo.getPath('testPreDeployWorkflowRepo') || '';
const workflowPath = path.join(repoPath, '.github', 'workflows', 'preDeploy.yml');
let act = new utils.ExtendedAct(repoPath, workflowPath);
let act = new eAct.ExtendedAct(repoPath, workflowPath);
act = utils.setUpActParams(
act,
'push',
Expand Down

0 comments on commit 1ebc0d1

Please sign in to comment.