Skip to content

Commit 3fcc8be

Browse files
author
naman-contentstack
committed
[DX-2346], added config test cases in pipeline and resolved comment
1 parent 74edda5 commit 3fcc8be

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

.github/workflows/unit-test.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@ jobs:
1919
- name: Install dependencies for all plugins
2020
run: |
2121
npm run setup-repo-old
22-
22+
2323
- name: Run tests for Audit plugin
2424
working-directory: ./packages/contentstack-audit
2525
run: npm run test:unit
2626

27+
- name: Run tests for Contentstack Config
28+
working-directory: ./packages/contentstack-config
29+
run: npm run test
2730
# - name: Fetch latest references
2831
# run: |
2932
# git fetch --prune
@@ -41,11 +44,11 @@ jobs:
4144
# CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
4245
# echo "Changed files:"
4346
# echo "$CHANGED_FILES"
44-
47+
4548
# # Identify affected plugins
4649
# AFFECTED_PLUGINS=$(echo "$CHANGED_FILES" | grep -oP '(?<=^packages/)([^/]+)' | sort -u | tr '\n' ' ')
4750
# echo "Affected plugins: $AFFECTED_PLUGINS"
48-
51+
4952
# # Set output for the next step
5053
# echo "::set-output name=affected_plugins::$AFFECTED_PLUGINS"
5154

@@ -59,4 +62,4 @@ jobs:
5962
# else
6063
# echo "contentstack-audit has not changed. Skipping tests."
6164
# fi
62-
# done
65+
# done

packages/contentstack-config/src/commands/config/set/region.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export default class RegionSetCommand extends BaseCommand<typeof RegionSetComman
120120
this.logger.error('failed to set the region', error);
121121
cliux.error(`Failed to set region due to: ${error.message}`);
122122
}
123-
} else if (['NA', 'EU', 'AWS-NA', 'AWS-EU', 'AZURE-NA', 'AZURE-EU', 'GCP-NA', 'GCP-EU'].includes(selectedRegion)) {
123+
} else if (['NA', 'EU', 'AZURE-NA', 'AZURE-EU', 'GCP-NA', 'GCP-EU'].includes(selectedRegion)) {
124124
const regionDetails: Region = regionHandler.setRegion(selectedRegion);
125125
await authHandler.setConfigData('logout'); //Todo: Handle this logout flow well through logout command call
126126
cliux.success(`Region has been set to ${regionDetails.name}`);

packages/contentstack-config/src/utils/interactive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export const askRegions = async (): Promise<string> => {
99
choices: [
1010
{ name: 'NA', value: 'NA' },
1111
{ name: 'EU', value: 'EU' },
12-
{ name: 'AWS-NA', value: 'AWS-NA' },
13-
{ name: 'AWS-EU', value: 'AWS-EU' },
12+
{ name: 'AWS-NA', value: 'NA' },
13+
{ name: 'AWS-EU', value: 'EU' },
1414
{ name: 'AZURE-NA', value: 'AZURE-NA' },
1515
{ name: 'AZURE-EU', value: 'AZURE-EU' },
1616
{ name: 'GCP-NA', value: 'GCP-NA' },

0 commit comments

Comments
 (0)