Skip to content

Conversation

@Marc-Andre-Rivet
Copy link
Contributor

@Marc-Andre-Rivet Marc-Andre-Rivet commented Apr 20, 2020

Based on the community PR #1125:

  • Adds sanity testing for component with nested (and standard non-nested) artifacts
  • Updates the R component generator to include all nested files in the target folder instead of only the files directly in the current folder
  • Allows component authors to use the same target name for both R and Python generation, whatever the artifacts folder structure
  • Replace dash-render-test-components.UncontrolledInput usage with dcc.Input

if not os.path.exists(target_dirname):
os.makedirs(target_dirname)

shutil.copy(os.path.join(rel_dirname, filename), target_dirname)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is the real change - everything else is just for the nested/standard file structure test.

Instead of globing files w/o recursion, glob with recursion (using os.walk because glob.glob does not support the recursive named param in py27)

dash_duo.start_server(app)

assert dash_duo.wait_for_element("#standard").text == "Standard"
assert dash_duo.wait_for_element("#nested").text == "Nested"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if both dummy standard and nested components load correctly

@Marc-Andre-Rivet Marc-Andre-Rivet changed the title Pr1125 tests Component nested artifacts + Test Apr 20, 2020
@Marc-Andre-Rivet Marc-Andre-Rivet marked this pull request as ready for review April 20, 2020 20:29
"private::lint.pylint-tests": "PYLINTRC=${PYLINTRC:=.pylintrc37} && pylint tests/unit tests/integration -d all --rcfile=$PYLINTRC",
"private::lint.renderer": "cd dash-renderer && npm run lint",
"private::test.setup-nested": "cd \\@plotly/dash-generator-test-component-nested && npm ci && npm run build && pip install -e .",
"private::test.setup-standard": "cd \\@plotly/dash-generator-test-component-standard && npm ci && npm run build && pip install -e .",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is your plan - the reason these packages are up in @plotly rather than in tests - to publish them for use in the R (& Julia) tests?

Copy link
Contributor Author

@Marc-Andre-Rivet Marc-Andre-Rivet Apr 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Don't plan on publishing them at this point. I simply wanted to isolate them from other concerns. The package.json file contains "private": true which should prevent accidental publication. R/Julia tests would be expected to git clone and build the components atm.

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃 Thanks for 🔪 dash-renderer-test-components 🎉 🏆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants