Skip to content

Commit

Permalink
test: linux dir creation for migration
Browse files Browse the repository at this point in the history
  • Loading branch information
joacoc committed Oct 24, 2023
1 parent 7395f06 commit e8156f7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/test/suite/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ suite('Extension Test Suite', () => {
// TODO: Remove after 0.3.0
test('Migration', async () => {
const configDir = `${os.homedir()}/.config/materialize/test`;
if (!fs.existsSync(configDir)) {
try {
fs.mkdirSync(configDir, { recursive: true });
console.log("[Context]", "Directory created: ", configDir);
} catch (error) {
console.log("[Context]", "Error creating configuration file dir:", configDir, error);
throw error;
}
}

const filePath = `${configDir}/mz.toml`;
process.env["MZ_CONFIG_PATH"] = configDir;

Expand All @@ -83,6 +93,7 @@ suite('Extension Test Suite', () => {
await delay(500);
let content = fs.readFileSync(filePath, 'utf-8');
console.log("Content: ", content);

if (process.platform === "darwin") {
// Assert the migration is done.
assert.ok(content === `profile = "default"\n\n[profiles.default]\nregion = "aws/us-east-1"\n\n[profiles.alternative]\napp-password = "mzp_4e5c0aea72ac41de946c57f1b67bb3af4e5c0aea72ac41de946c57f1b67bb3af"\nregion = "aws/us-east-1"\nvault = "inline"\n`);
Expand Down

0 comments on commit e8156f7

Please sign in to comment.