I can think of many situations where I have a pre-compiled schema, I've
made changes, but I still want to run using the old one, not wait 2 or 3
minutes for a new one to be created.

Here's my workaround:

   1. Temporarily set daffodilTdmlUsesPackageBin := false
   2. Temporarily change model attribute of every test case to point at a
   tempdir location.
      1. (Enhancement: a tdml:testSuite defaultModel attribute where one
      could specify the model to be used in one place, not in every test case.
      This makes modifying the test suite to point it at a specific
location for
      the binary model file a one-line edit, not a giant multi-replacement)
   3. sbt packageDaffodilBin
   4. copy the binary file to the tmpdir location.

Here is what I don't understand.

When the TDML runner is called, and the model for the test case identifies
a binary file, somehow the schema version and daffodil-version information
are added to it.

Where does the TDML runner get this information from? I would expect that
information is available to SBT, but how can the TDML runner get it?


On Mon, Oct 28, 2024 at 9:36 AM Steve Lawrence <slawre...@apache.org> wrote:

> There is not currently a setting that does that. We could probably add one
> pretty easily, but it feels like it could be a bit fragile?
>
> For example, say this new setting is enabled and you run
> packageDaffodilBin to
> build a saved parser and you run "sbt test" and all test pass. Then you
> make
> changes to the schema that accidentally break things, but forget to run
> "packgeDaffodilBin". If you run "sbt test" all the tests will pass because
> you're using an older saved parser even though they should fail. The
> current
> logic detects when schema changes have been made and will force a rebuild
> when
> you run tests.
>
> Would it work to temporarily change daffodilTdmlUsesPackageBin to false
> while
> you do things that don't need a binary and then change it back when your
> done?
> Or would there be too much switching?
>
> If that would be too much of a headache, we can definitely add setting,
> but it
> would have to come with a warning that it's up to the user to not forget
> to
> rebuild schemas when running tests. We might be able to output a warning
> if
> tests are run and the cache is old, but dealing with SBT cache is tricky,
> so it
> might not be possible.
>
>
> On 2024-10-25 07:56 PM, Mike Beckerle wrote:
> >
> > So in IntelliJ when I run a main app that is part of src/test/scala, the
> build
> > process runs packageDaffodilBin and that recompiles the entire schema.
> >
> > This takes *minutes* for this large schema.
> >
> > Is there a setting I can use to tell it to only recompile the binary
> schema when
> > I specifically request it by 'sbt packageDaffodilBin' ?
> >
> > I don't want to turn off use of the binary by TDML tests. I just want to
> turn
> > off all automatic such compilation.
> >
> > If the compiled binary doesn't exist I want a diagnostic error from
> whatever was
> > looking for it, not an automatic recompile.
> >
> >
> >
> >
> >
>
>

Reply via email to