Skip to content
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

Continued Execution Context work and some little fixes #6506

Merged
merged 12 commits into from
May 3, 2023

Conversation

jdunkerley
Copy link
Member

@jdunkerley jdunkerley commented May 2, 2023

Pull Request Description

  • Add with_disabled shortcut for Context.
  • Protect Image.write behind Context.Output.
  • Correct text on the Forbidden_Operation error message.
  • Remove context overrides from tests.
  • Add File operations tests with Context.Output disabled.
  • Add tests for Text.write operations with Context.Output disabled.
  • Use a better method to make File_Format dropdown widget.
  • Fix bug in Invalid_Format.to_display_text.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

- Protect `Image.write`
- Correct text on error message.
- Remove context overrides from tests.
- Add test for `File` operations in context.
- Fix issue with appending to dry run.
@jdunkerley jdunkerley force-pushed the wip/jd/image-write-and-nits branch from 0f84e73 to 4030748 Compare May 2, 2023 16:22
@jdunkerley jdunkerley added the CI: No changelog needed Do not require a changelog entry for this PR. label May 2, 2023
@jdunkerley jdunkerley marked this pull request as ready for review May 2, 2023 16:33
…t.enso

Co-authored-by: Radosław Waśko <radoslaw.wasko@enso.org>
Test.group "Delimited File Writing" <| Context.Output.with_enabled <|
Test.group "Delimited File Writing" <|
Copy link
Member

Choose a reason for hiding this comment

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

So glad to see all of these gone.

Comment on lines +418 to +430
Test.specify "should perform a dry run appending text to a file if Context.Output is disabled" <|
f = transient / "work.txt"
f.delete_if_exists
"line 1!".write f on_existing_file=Existing_File_Behavior.Append on_problems=Report_Error . should_succeed . should_equal f

Context.Output.with_disabled <|
r = '\nline 2!'.write f on_existing_file=Existing_File_Behavior.Append on_problems=Report_Error
Problems.expect_only_warning Dry_Run_Operation r
r.exists.should_be_true
r.read_text.should_equal 'line 1!\nline 2!'
f.read_text.should_equal 'line 1!'

Context.Output.with_enabled <| r.delete_if_exists
Copy link
Member

Choose a reason for hiding this comment

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

This is great

Copy link
Member

@radeusgd radeusgd left a comment

Choose a reason for hiding this comment

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

Looks all very good, I'm glad that we are getting this tested.

We need to align the description of the no-backup test with the contents as currently they contradict each other and that is bad - it results in it being unclear what is the expected behaviour - creating a backup or not doing it??

Other than that, some cosmetic comments, low priority so feel free to ignore.

test/Tests/src/System/File_Spec.enso Outdated Show resolved Hide resolved
@jdunkerley jdunkerley added the CI: Ready to merge This PR is eligible for automatic merge label May 2, 2023
@mergify mergify bot merged commit bb8f910 into develop May 3, 2023
@mergify mergify bot deleted the wip/jd/image-write-and-nits branch May 3, 2023 08:01
@jdunkerley jdunkerley linked an issue May 3, 2023 that may be closed by this pull request
2 tasks
Procrat added a commit that referenced this pull request May 3, 2023
* develop: (34 commits)
  Continued Execution Context work and some little fixes (#6506)
  IDE's logging to a file (#6478)
  Fix application config (#6513)
  Cloud/desktop mode switcher (#6448)
  Fix doubled named arguments bug (#6422)
  Reimplement `enso_project` as a proper builtin (#6352)
  Fix layer ordering between dropdown and breadcrumbs backgrounds.  (#6483)
  Multiflavor layers (#6477)
  DataflowAnalysis preserves dependencies order (#6493)
  Implement `create_database_table` for Database Table (#6467)
  Limit Dead Letter logging (#6482)
  More reliable shutdown of the EnsoContext to save resources (#6468)
  Make execution mode `live` default for CLI (#6496)
  Finishing Vector Editor (#6470)
  Proper handling of multiple list views. (#6461)
  Fix disappearing cached shapes (#6458)
  Add Execution Context control to Text.write (#6459)
  Change defaults for `Connection.tables` and ensure that `Connection.query` recognizes all available tables (#6443)
  Introducing @BuiltinMethod.needsFrame and InlineableNode (#6442)
  Hide profile button behind a feature flag (#6430)
  ...
Procrat added a commit that referenced this pull request May 4, 2023
* develop:
  Fix cut-off in text visualisations (#6421)
  Infer correct synthetic name for nested modules (#6525)
  Delete unused websocket dependency (#6535)
  Run typecheck and eslint on `./run lint` (#6314)
  Force pending saves if client closes abruptly (#6514)
  Continued Execution Context work and some little fixes (#6506)
  IDE's logging to a file (#6478)
  Fix application config (#6513)
  Cloud/desktop mode switcher (#6448)
  Fix doubled named arguments bug (#6422)
  Reimplement `enso_project` as a proper builtin (#6352)
  Fix layer ordering between dropdown and breadcrumbs backgrounds.  (#6483)
  Multiflavor layers (#6477)
  DataflowAnalysis preserves dependencies order (#6493)
  Implement `create_database_table` for Database Table (#6467)
  Limit Dead Letter logging (#6482)
  More reliable shutdown of the EnsoContext to save resources (#6468)
  Make execution mode `live` default for CLI (#6496)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing warning message for parse in the IDE
3 participants