Skip to content

Commit

Permalink
[CHORE] feature flag reversal test (#6752)
Browse files Browse the repository at this point in the history
* [CHORE] feature flag reversal test

* just delete the travis job
  • Loading branch information
runspired authored and igorT committed Nov 16, 2019
1 parent 68ddef8 commit c0b775c
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 14 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,20 @@ jobs:
) || github.event_name == 'push' && (
endsWith(github.ref, '/master') || endsWith(github.ref, '/beta')
)
name: In progress features
name: Enable All In progress features
env:
EMBER_DATA_FEATURE_OVERRIDE: ENABLE_ALL_OPTIONAL
run: yarn test:enabled-in-progress-features
run: yarn test
- if: |
github.event_name == 'pull_request' && (
github.base_ref == 'master' || github.base_ref == 'beta'
) || github.event_name == 'push' && (
endsWith(github.ref, '/master') || endsWith(github.ref, '/beta')
)
name: Disabled All In progress features
env:
EMBER_DATA_FEATURE_OVERRIDE: DISABLE_ALL
run: yarn test
floating-dependencies:
needs: [lint, basic-tests]
Expand Down
7 changes: 1 addition & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ jobs:

- stage: additional tests

name: 'Enabled In-Progress Features'
if: NOT tag IS present AND NOT (branch ~= /^(emberjs:release|emberjs:lts|release|lts).*/)
install: yarn install
script: yarn test:enabled-in-progress-features

- name: 'Floating Dependencies'
name: 'Floating Dependencies'
install: yarn install --no-lockfile --non-interactive
script: yarn test

Expand Down
22 changes: 18 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,16 @@ jobs:
yarn
- script: |
yarn test:enabled-in-progress-features
yarn test
env:
EMBER_DATA_FEATURE_OVERRIDE: ENABLE_ALL_OPTIONAL
displayName: 'In progress features'
displayName: 'Enable All In progress features'
- script: |
yarn test
env:
EMBER_DATA_FEATURE_OVERRIDE: DISABLE_ALL
displayName: 'Disable All In progress features'
- script: |
yarn test:production
Expand Down Expand Up @@ -150,8 +156,16 @@ jobs:
displayName: 'Basic Tests'
- script: |
yarn test:enabled-in-progress-features
displayName: 'In progress features'
yarn test
env:
EMBER_DATA_FEATURE_OVERRIDE: ENABLE_ALL_OPTIONAL
displayName: 'Enable All In progress features'
- script: |
yarn test
env:
EMBER_DATA_FEATURE_OVERRIDE: DISABLE_ALL
displayName: 'Disable All In progress features'
- script: |
yarn test:production
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"test:docs": "yarn workspace ember-data test:docs",
"test:encapsulation": "lerna run --scope='*-encapsulation-test-app' test",
"test:fastboot": "yarn workspace fastboot-test-app test",
"test:enabled-in-progress-features": "yarn workspace ember-data test:optional-features",
"test-external:ember-m3": "./bin/test-external-partner-project.js ember-m3 https://github.com/hjdivad/ember-m3.git",
"test-external:ember-data-change-tracker": "./bin/test-external-partner-project.js ember-data-change-tracker https://github.com/danielspaniel/ember-data-change-tracker.git",
"test-external:model-fragments": "./bin/test-external-partner-project.js ember-data-model-fragments https://github.com/lytics/ember-data-model-fragments.git",
Expand Down
1 change: 0 additions & 1 deletion packages/-ember-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"test": "ember test",
"test:all": "ember try:each",
"test:production": "ember test -e production",
"test:optional-features": "ember test",
"test:try-one": "ember try:one",
"test:docs": "mkdir -p dist && qunit node-tests/docs/test-coverage.js",
"prepublishOnly": "mkdir -p dist && ember ember-cli-yuidoc"
Expand Down
5 changes: 5 additions & 0 deletions packages/private-build-infra/src/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ function getFeatures(isProd) {
features[feature] = true;
}
}
} else if (FEATURE_OVERRIDES === 'DISABLE_ALL') {
// disable all features, including those with a value of `true`
for (let feature in features) {
features[feature] = false;
}
} else if (FEATURE_OVERRIDES) {
// enable only the specific features listed in the environment
// variable (comma separated)
Expand Down

0 comments on commit c0b775c

Please sign in to comment.