Skip to content

Commit 84103e9

Browse files
authored
with with RUNNING_IN_DEVCONTAINERS_CLI_REPO_CI
1 parent 5aa178a commit 84103e9

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/dev-containers.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ jobs:
7777
run: yarn package
7878
- name: Run Tests
7979
run: yarn test-matrix --forbid-only ${{ matrix.mocha-args }}
80+
env:
81+
CI: true
82+
RUNNING_IN_DEVCONTAINERS_CLI_REPO_CI: ${{ env.RUNNING_IN_DEVCONTAINERS_CLI_REPO_CI }}
8083
tests:
8184
name: Tests
8285
needs: tests-matrix

src/test/container-features/registryCompatibilityOCI.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ const registryCompatibilityTestPlan: TestPlan[] = [
6767
}
6868
];
6969

70+
function envVariableExists(key: string): boolean {
71+
return !!process.env[key] && process.env[key] !== '';
72+
}
73+
7074
function constructAuthFromStrategy(tmpFolder: string, authStrategy: AuthStrategy, authStrategyKey?: string): string | undefined {
7175
const generateAuthFolder = () => {
7276
const randomChars = Math.random().toString(36).substring(2, 6);
@@ -116,7 +120,7 @@ describe('Registry Compatibility', function () {
116120
registryCompatibilityTestPlan.forEach(({ name, configName, testFeatureId, testCommand, testCommandResult, useAuthStrategy, authStrategyKey }) => {
117121
this.timeout('120s');
118122
describe(name, async function () {
119-
((authStrategyKey && !process.env[authStrategyKey]) ? describe.skip : describe)('devcontainer up', async function () {
123+
((authStrategyKey && !envVariableExists(authStrategyKey)) ? describe.skip : describe)('devcontainer up', async function () {
120124

121125
const authFolder = constructAuthFromStrategy(tmp, useAuthStrategy ?? AuthStrategy.Anonymous, authStrategyKey) || '/fake-path';
122126

@@ -138,7 +142,7 @@ describe('Registry Compatibility', function () {
138142
});
139143
});
140144

141-
((authStrategyKey && !process.env[authStrategyKey]) ? describe.skip : describe)(`devcontainer features info manifest`, async function () {
145+
((authStrategyKey && !envVariableExists(authStrategyKey)) ? describe.skip : describe)(`devcontainer features info manifest`, async function () {
142146

143147
const authFolder = constructAuthFromStrategy(tmp, useAuthStrategy ?? AuthStrategy.Anonymous, authStrategyKey) || '/fake-path';
144148

0 commit comments

Comments
 (0)