feat(core): align GitHub metadata handling with other backends (#3316)

* Revert "Revert "feat(core): Align GitHub metadata handling with other backends (#3292)""

This reverts commit 5bdd3df9ccbb5149c22d79987ebdcd6cab4b261f.

* fix(backend-github): fix migration code

* test(backend-github): fix test

* test(e2e): shorten wait time

* test(e2e): try and fix test on CI
This commit is contained in:
Erez Rokah
2020-02-24 23:44:10 +01:00
committed by GitHub
parent dcb0c9cfbe
commit 7e0a8ad532
95 changed files with 36118 additions and 36295 deletions

View File

@ -13,7 +13,13 @@
require('dotenv').config();
const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin');
const { setupGitHub, teardownGitHub, setupGitHubTest, teardownGitHubTest } = require('./github');
const {
setupGitHub,
teardownGitHub,
setupGitHubTest,
teardownGitHubTest,
seedGitHubRepo,
} = require('./github');
const {
setupGitGateway,
teardownGitGateway,
@ -29,7 +35,7 @@ const {
} = require('./bitbucket');
const { setupProxy, teardownProxy, setupProxyTest, teardownProxyTest } = require('./proxy');
const { copyBackendFiles } = require('../utils/config');
const { copyBackendFiles, switchVersion } = require('../utils/config');
module.exports = async (on, config) => {
// `on` is used to hook into various events Cypress emits
@ -133,6 +139,28 @@ module.exports = async (on, config) => {
break;
}
return null;
},
async seedRepo(taskData) {
const { backend } = taskData;
console.log(`Seeding repository for backend`, backend);
switch (backend) {
case 'github':
await seedGitHubRepo(taskData);
break;
}
return null;
},
async switchToVersion(taskData) {
const { version } = taskData;
console.log(`Switching CMS to version '${version}'`);
await switchVersion(version);
return null;
},
});