Skip to content

coverage report is crashing when running with several connections #20

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

Closed
jgebal opened this issue Jun 24, 2015 · 4 comments · Fixed by #22
Closed

coverage report is crashing when running with several connections #20

jgebal opened this issue Jun 24, 2015 · 4 comments · Fixed by #22

Comments

@jgebal
Copy link
Contributor

jgebal commented Jun 24, 2015

To reproduce:
place 2 connection definitions in database.yml
have a test (that utilizes one of the connections)
execute
plsql-spec --coverage

And you get:

Running all specs from spec/
stmt.c:250:in oci8lib_191.so: ORA-00942: table or view does not exist (OCIError)
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.8-x86-mingw32/lib/oci8/cursor.rb:126:in `exec'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-plsql-0.5.3/lib/plsql/oci_connection.rb:109:in `exec'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-plsql-0.5.3/lib/plsql/oci_connection.rb:94:in `new_from_query'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-plsql-0.5.3/lib/plsql/oci_connection.rb:144:in `cursor_from_query'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-plsql-0.5.3/lib/plsql/connection.rb:116:in `select_all'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-plsql-0.5.3/lib/plsql/sql_statements.rb:10:in `select_all'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-plsql-spec-0.4.0/lib/plsql/coverage.rb:106:in `coverage_data'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-plsql-spec-0.4.0/lib/plsql/coverage.rb:74:in `report'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-plsql-spec-0.4.0/lib/plsql/coverage.rb:66:in `report'
        from C:/Users/Jacek/RubymineProjects/utplsql_vs_plsql_spec/spec/spec_helper.rb:43:in `block (2 levels) in <top (required)>'
        from C:/Users/Jacek/RubymineProjects/utplsql_vs_plsql_spec/spec/spec_helper.rb:36:in `each'
        from C:/Users/Jacek/RubymineProjects/utplsql_vs_plsql_spec/spec/spec_helper.rb:36:in `block in <top (required)>'
@javornikolov
Copy link
Collaborator

Are the two connections to the same database schema?

@jgebal
Copy link
Contributor Author

jgebal commented Jun 24, 2015

Yes. Good point.
Seems like profiler tables are dropped directly after reading from them by connection.
I think it would be better to separate the cleanup from the read of profiler data.
This way we can call cleanup in a separate loop after reading all the data for all connections.

Alternatively we could read once for each unique database-user pair. That would also solve the problem. It could also improve on performance - data would be read only once for each unique database-user.

What do you think?

@jgebal
Copy link
Contributor Author

jgebal commented Jul 25, 2015

The workaround for this issue is to have the plsql profiler tables created and accessible on the database prior to running the tests.
This way ruby-plsql-spec is not dropping the tables but is simply removing the data from it.

@javornikolov
Copy link
Collaborator

@jgebal could you check if #22 helps?

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 a pull request may close this issue.

2 participants