Giter Club home page Giter Club logo

Comments (4)

josevalim avatar josevalim commented on June 12, 2024

@jonatanklosko for some reason, the autosave_path was saved in storage as nil. I can't find a codepath that makes this possible though. Do we use it only for tests? Maybe Simon accidentally ran tests against his default storage?

from livebook.

jonatanklosko avatar jonatanklosko commented on June 12, 2024

@josevalim the storage-based configuration was introduced in 4061aa1 and I don't think we ever had a way to set nil from the user side. In the past it was an env var, which could've been nil, but that wasn't persisted into storage. So the only option I can think of is tests. I think handling nil makes sense, that's why the spec is @spec autosave_path() :: String.t() | nil, but I'd say we don't need to have the enable logic.

If nil was an expected past value, I would do a migration, but I don't think that's the case here.

@simonmcconnell have you run Livebook tests locally, and do you have LIVEBOOK_DATA_PATH in your .bashrc? (if so then runtime.exs config takes precedence over test.exs and so this could happen)

from livebook.

simonmcconnell avatar simonmcconnell commented on June 12, 2024

I have a copy of livebook as a git clone and have it installed using the Windows installer. This was started using the shortcut in the start menu.

There is _build/test in the git clone. Looks like I ran tests on 31 August 2023. No livebook environment variables are set.

test.exs:

import Config

# We don't run a server during test. If one is required,
# you can enable the server option below.
config :livebook, LivebookWeb.Endpoint,
  http: [port: 4002],
  server: false

# Print only warnings and errors during test
config :logger, level: :warning

# Disable authentication mode during test
config :livebook,
  authentication_mode: :disabled,
  check_completion_data_interval: 300,
  iframe_port: 4003

data_path = Path.expand("tmp/livebook_data/test")

# Clear data path for tests
if File.exists?(data_path) do
  File.rm_rf!(data_path)
end

config :livebook, :data_path, data_path

# Use longnames when running tests in CI, so that no host resolution is required,
# see https://github.com/livebook-dev/livebook/pull/173#issuecomment-819468549
if System.get_env("CI") == "true" do
  config :livebook, :node, {:longnames, :"[email protected]"}
end

from livebook.

jonatanklosko avatar jonatanklosko commented on June 12, 2024

Curious, the data env var is the only idea I have.

from livebook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.