Tente un fixe pour la pipeline.

This commit is contained in:
Simon
2023-05-18 21:17:34 +00:00
parent 226a3a3856
commit 123733def0
7 changed files with 34 additions and 24 deletions

View File

@@ -5,10 +5,11 @@ const { exit } = require("process");
// Fetch envs to target the right folder
const slug = process.env["PACKAGE_NAME"];
const workDir = process.env["CI_PROJECT_DIR"];
const root = process.env["ENTRY_FOLDER"];
if (!slug || !root) exit(1);
let workingDirectory = path.join(root, slug);
const slug = process.env["PACKAGE_NAME"];
if (!workDir || !slug || !root) exit(1);
let workingDirectory = path.join(workDir, root, slug);
// extract metadata from them
fs.readdir(workingDirectory, (err, files) => {

View File

@@ -33,11 +33,13 @@ function flatReferences(manifest) {
describe('Mandatory Checks', function () {
before(function () {
const workDir = process.env["CI_PROJECT_DIR"];
expect(workDir).to.be.a("string").that.is.not.empty;
const slug = process.env["PACKAGE_NAME"];
expect(slug).to.be.a("string").that.is.not.empty;
const root = process.env["ENTRY_FOLDER"];
expect(root).to.be.a("string").that.is.not.empty;
workingDirectory = path.join(root, slug);
workingDirectory = path.join(workDir, root, slug);
files = fs.readdirSync(workingDirectory);
expect(files).to.be.an('array').that.is.not.empty;
validator = ajv.compile(JSON.parse(fs.readFileSync(themeSchemaFile, 'utf8')));

View File

@@ -40,9 +40,10 @@ def _validate_brightness_image(working_path, theme_config, high_light, image_lis
@pytest.fixture
def working_path():
# get the global variables containing gitlab-given project slug.
work_directory = os.environ["CI_PROJECT_DIR"]
entry_folder = os.environ["ENTRY_FOLDER"]
project_slug = os.environ["PACKAGE_NAME"]
root_folder = os.environ["ENTRY_FOLDER"]
working_path = Path(root_folder, project_slug)
working_path = Path(work_directory, entry_folder, project_slug)
if not working_path.is_dir():
raise FileNotFoundError(f"No project found for the given {working_path}.")
return working_path