New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback-aware failure handling for data-bridge - integration test #35

Merged
merged 6 commits into from Dec 12, 2018

Conversation

Projects
None yet
2 participants
@scypio
Copy link
Contributor

scypio commented Dec 10, 2018

Description

Integration test for data bridge and fragment processing failure handling

Motivation and Context

New proposed feature was implemented in knotx core - Cognifide/knotx#466. I would like to add an integration test to make sure that it is working

Screenshots (if appropriate)

N/A

Upgrade notes (if appropriate)

Requires Cognifide/knotx#466

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

I hereby agree to the terms of the Knot.x Contributor License Agreement.

@Skejven
Copy link
Member

Skejven left a comment

Thanks @scypio

@Skejven
Copy link
Member

Skejven left a comment

Could you please add defaultFallback commented out with short comment (as docs) to the knotx-stack-manager/src/main/packaging/conf/application.conf ? Also please add commented out section with proper comment.

    defaultFallback = MY_GLOBAL_ID
    fallbacks = [
      {
        id = MY_GLOBAL_ID
        markup = "<knotx:fallback data-knotx-fallback-id='MY_GLOBAL_ID'><p class='error'>error</p></knotx:fallback>"
      }
    ]
@@ -176,6 +177,13 @@ public void whenRequestingLocalSimplePageWithCustomTag_expectLocalSimpleHtml(
"localSimpleResultAngular.html");
}

@Test
@KnotxApplyConfiguration("knotx-test-app.conf")
public void whenRequestingFailingServiceWithFallback_expectFallback(

This comment has been minimized.

@Skejven

Skejven Dec 11, 2018

Member

Could you please add one more test that checks if globally set fallback (in config) works?

This comment has been minimized.

@scypio

scypio Dec 11, 2018

Contributor

configuration example and global fallback test added

}

@Test
@KnotxApplyConfiguration("knotx-test-app-global-fallback.conf")

This comment has been minimized.

@Skejven

Skejven Dec 11, 2018

Member

You may add

    defaultFallback = MY_GLOBAL_ID
    fallbacks = [
      {
        id = MY_GLOBAL_ID
        markup = "<p class='error'>global fallback</p>"
      }
    ]

directly to the knotx-test-app.conf.
If you want to add some extra config, please don't copy the whole file (if we do the change in the future we will have to change in multiple places). You may override just a part of a config, @KnotxApplyConfiguration supports this.
Look at the whenRequestingLocalSimplePageWithGetCustomAndDefaultSymbol_expectLocalSimpleHtmlWithDefault. It defines two config files:
@KnotxApplyConfiguration({"knotx-test-app.conf", "knotx-test-handlebars-custom-symbol.conf"})
Where knotx-test-handlebars-custom-symbol.conf overrides some configs from the knotx-test-app.conf.

This comment has been minimized.

@scypio

scypio Dec 11, 2018

Contributor

changed the test to use a dedicated, minimal config file

@Skejven Skejven merged commit 40aa141 into Knotx:master Dec 12, 2018

2 checks passed

CodeFactor No issues found.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment