refactor: change prefix to suffix

This commit is contained in:
Mauricio Siu
2024-09-03 23:58:56 -06:00
parent beb84554e1
commit b6fd92aadd
37 changed files with 480 additions and 480 deletions
@@ -1,7 +1,7 @@
import { generateRandomHash } from "@/server/utils/docker/compose";
import {
addPrefixToAllConfigs,
addPrefixToConfigsRoot,
addSuffixToAllConfigs,
addSuffixToConfigsRoot,
} from "@/server/utils/docker/compose/configs";
import type { ComposeSpecification } from "@/server/utils/docker/types";
import { load } from "js-yaml";
@@ -80,12 +80,12 @@ configs:
file: ./db-config.yml
`) as ComposeSpecification;
test("Add prefix to all configs in root and services", () => {
test("Add suffix to all configs in root and services", () => {
const composeData = load(composeFileCombinedConfigs) as ComposeSpecification;
const prefix = "testhash";
const suffix = "testhash";
const updatedComposeData = addPrefixToAllConfigs(composeData, prefix);
const updatedComposeData = addSuffixToAllConfigs(composeData, suffix);
expect(updatedComposeData).toEqual(expectedComposeFileCombinedConfigs);
});
@@ -162,14 +162,14 @@ configs:
file: ./db-config.yml
`) as ComposeSpecification;
test("Add prefix to configs with environment and external", () => {
test("Add suffix to configs with environment and external", () => {
const composeData = load(
composeFileWithEnvAndExternal,
) as ComposeSpecification;
const prefix = "testhash";
const suffix = "testhash";
const updatedComposeData = addPrefixToAllConfigs(composeData, prefix);
const updatedComposeData = addSuffixToAllConfigs(composeData, suffix);
expect(updatedComposeData).toEqual(expectedComposeFileWithEnvAndExternal);
});
@@ -234,14 +234,14 @@ configs:
file: ./db-config.yml
`) as ComposeSpecification;
test("Add prefix to configs with template driver and labels", () => {
test("Add suffix to configs with template driver and labels", () => {
const composeData = load(
composeFileWithTemplateDriverAndLabels,
) as ComposeSpecification;
const prefix = "testhash";
const suffix = "testhash";
const updatedComposeData = addPrefixToAllConfigs(composeData, prefix);
const updatedComposeData = addSuffixToAllConfigs(composeData, suffix);
expect(updatedComposeData).toEqual(
expectedComposeFileWithTemplateDriverAndLabels,