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

Failure when Re-running Tests #197

Closed
brodieG opened this issue Nov 29, 2016 · 2 comments
Closed

Failure when Re-running Tests #197

brodieG opened this issue Nov 29, 2016 · 2 comments

Comments

@brodieG
Copy link
Owner

brodieG commented Nov 29, 2016

# within validate..
unitize_dir()
# poke around a bit, finally, select 5 for validate.R
N # a bunch of times
devtools::install()
R
Y

and at this point:

| Re-run unitizer ([Y]es, [P]rev, [B]rowse, [U]nreviewed, [R]erun, f[O]rce)?

unitizer> Y

Error in slot(z, i)[[id]] : subscript out of bounds
| Unexpectedly exited before storing unitizer; if you were reviewing a unitizer 
| changes to that unitizer were not saved.  Note that any unitizers you *
| completed* review of should have been saved.
@brodieG brodieG added the bug label Nov 29, 2016
@brodieG brodieG added this to the 1.4.0 milestone Nov 29, 2016
@brodieG
Copy link
Owner Author

brodieG commented Nov 29, 2016

Actually, happened with an even simpler scenario:


> unitize_dir()

| Summary of files in common directory 'unitizer':                              
| 
|                      Pass Fail
| *1.          eval.R    19    9
|  2.          misc.R     9    -
| *3.         parse.R    40    9
| *4. validate.args.R    15   13
| *5.      validate.R    41   20
| ..............................
|                       124   51
| Legend:
| * `unitizer` requires review

| Type number of unitizer to review, 'A' to review all that require review

unitizer> 5
+------------------------------------------------------------------------------+
| unitizer for: unitizer/validate.R                                            |
+------------------------------------------------------------------------------+

                       Pass Fail
          Tokens Pass    22    -
          Tokens Fail    16   14
 Compound Expressions     3    3
   Other Return Modes     -    3
................................
                         41   20

= Tokens Fail ==================================================================

- Failed -----------------------------------------------------------------------

| The 14 tests in this section failed because the new evaluations do not match 
| the reference values from the store. Overwrite with new results ([Y]es, [N]o, 
| [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)?

> validate(INT.1, 1.2)
Error in validate(INT.1, 1.2) : 
  Argument `current` should `current` should be type "integer-like" (is "double"
)

| Conditions mismatch: 

< .REF$conditions                                                               
> .NEW$conditions                                                               
@@ 1,3 / 1,3 @@                                                                 
  Condition list with 1 condition:                                              
< 1. Error in validate(INT.1, 1.2) : Argument `current` should be type "integer-
<    like" (is "double")                                                        
> 1. Error in validate(INT.1, 1.2) : Argument `current` should `current` should 
>    be type "integer-like" (is "double")                                       

| State mismatch; see `.DIFF$state` for details.

unitizer> N

> validate(INT.1, 1:2)
Error in validate(INT.1, 1:2) : 
  Argument `current` should `current` should be length 1 (is 2)

| Conditions mismatch: 

< .REF$conditions                                                               
> .NEW$conditions                                                               
@@ 1,3 / 1,3 @@                                                                 
  Condition list with 1 condition:                                              
< 1. Error in validate(INT.1, 1:2) : Argument `current` should be length 1 (is  
<    2)                                                                         
> 1. Error in validate(INT.1, 1:2) : Argument `current` should `current` should 
>    be length 1 (is 2)                                                         

| State mismatch; see `.DIFF$state` for details.

unitizer> Q

| No changes recorded.
Error in slot(z, i)[[id]] : subscript out of bounds
| Unexpectedly exited before storing unitizer; if you were reviewing a unitizer 
| changes to that unitizer were not saved.  Note that any unitizers you *
| completed* review of should have been saved.

@brodieG
Copy link
Owner Author

brodieG commented Feb 22, 2017

Even simpler recreation with:

> unitize('validate.R')

| Inferred test file location: tests/unitizer/validate.R

+------------------------------------------------------------------------------+
| unitizer for: unitizer/validate.R                                            |
+------------------------------------------------------------------------------+

                       Pass Fail  New
          Tokens Pass    22    -    -
          Tokens Fail    30    -    -
 Compound Expressions     4    2    3
   Other Return Modes     -    3    -
     Multi-line Stuff     5    -    -
.....................................
                         61    5    3

= Compound Expressions =========================================================

- Failed -----------------------------------------------------------------------

| The 2 tests in this section failed because the new evaluations do not match 
| the reference values from the store. Overwrite with new results ([Y]es, [N]o, 
| [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)?

# Fail

> validate(INT.1 || NULL, 1.4)
Error in validate(INT.1 || NULL, 1.4) : 
  `1.4` should be type "integer-like", or "NULL" (is "double")

... snip

unitizer> Q

| No changes recorded.
Error in slot(z, i)[[id]] : subscript out of bounds
| Unexpectedly exited before storing unitizer; tests were not saved or changed.

The problem seems to be that the stored reference state is empty (i.e. corrupted), so in this part of the code state.merged <- mergeStates(items.ref, x@state.new, x@state.ref) in R/browse.R x@state.ref doesn't have anything in it even though items.ref references specific items. The problem is in the actual unitizer rds as shown by:

str(readRDS('tests/unitizer/validate.unitizer/data.rds')@state.ref)

Loading the rds from commit c3742e9 shows a populated @state.ref, so something went terribly wrong later. Need to figure out why @state.ref is not getting populated, and whether it is a fluke issue with this unitizer or a more systematic problem that was introduced.

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

No branches or pull requests

1 participant