Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Fix tests #96

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Fix tests #96

wants to merge 5 commits into from

Conversation

diegolovison
Copy link

ScriptEngine is thread safe and can be shared
new ScriptEngineManager(null) without that the tests are failing

Copy link
Member

@vjuranek vjuranek left a comment

Choose a reason for hiding this comment

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

Could you please also update commit message? Please either describe the changes in commit message or refer an issue which describes the problem. Btw: ignoring the test is not fixing the test:-)

@@ -485,12 +486,12 @@ private Double getValueFromMetric(TestExecution testExecution) {
private CommonTree parseTree(String string) {
//lexer splits input into tokens
ANTLRStringStream input = new ANTLRStringStream(string);
TokenStream tokens = new CommonTokenStream(new AlertingDSLLexer(input));
TokenStream tokens = new CommonTokenStream(new org.perfrepo.web.alerting.AlertingDSLLexer(input));
Copy link
Member

Choose a reason for hiding this comment

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

why do we need to to use fully qualified names?

Copy link
Author

Choose a reason for hiding this comment

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

IntelliJ doesn't like and is adding always the qualified name

Copy link
Member

Choose a reason for hiding this comment

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

well, I can understand re-ordering of imports (done by IDE) until we have some formatting rules, but don't understand why we should use fully qualified names in couple of places. Please remove it unless you have a good reason to use it.

Copy link
Author

Choose a reason for hiding this comment

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

It is not me 🤣
Every time, that I open the class or edit something in this class, Intellij is adding the full qualified name. I believe that it could be an issue with Intellij and antlr3

I prefer having the full qualified name instead of dealing with "txt editor" like Sublime to remove the full qualified name.

Copy link
Member

Choose a reason for hiding this comment

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

I prefer you fix your Inteliij instead of adding random stuff because of broken editors:-) (AFAIK @Holmistr who meinteined the code in past couple of year used Idea as well and haven't these problems, so it's very likely configuration issue)

@diegolovison
Copy link
Author

@vjuranek ready for another review. Thanks

@@ -35,6 +35,7 @@ Configure Maven to use JBoss Nexus repository. Follow the steps at https://devel

1. Create a database (e.g. named `perfrepo`)
2. Script `db_schema_creation.sql` in `model/src/main/sql` creates all necessary tables and structures
3. You should run `migration_*.sql` ignoring the errors
Copy link
Member

Choose a reason for hiding this comment

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

is this really needed? My understanding is running db_schema_creation.sql is sufficient and migration* is only for fixing exiting DB when we do some changes in the DB schema. But I need to verify it.

Copy link
Author

Choose a reason for hiding this comment

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

From db_schema_creation.sql we have

CREATE TABLE report_property (
  id bigint NOT NULL,
  report_id bigint NOT NULL,
  name character varying(2047) NOT NULL,
  value character varying(8192) NOT NULL
);

From migration_1_3_to1_4.sql we have

ALTER TABLE report_property ALTER COLUMN value type varchar(8192);

Copy link
Member

Choose a reason for hiding this comment

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

character varying and varchar are same thing AFAICT. I checked migration_1_4_to1_5.sql and migration_1_6_to1_7.sql and changes there were done also in db_schema_creation.sql.


```bash
mkdir -p $HOME/docker/volumes/postgres
docker run --rm --name perfrepo-db -e POSTGRES_PASSWORD=docker -d -p 5432:5432 -v $HOME/docker/volumes/postgres:/var/lib/postgresql/data postgres:8.4
```
Copy link
Member

Choose a reason for hiding this comment

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

not sure why old 8.4, 9.X as well as 10.X works fine (at least I didn't stop any issue so far)

@@ -180,6 +182,7 @@ public void testCreateInvalidMultivalueTestExecution() throws Exception {
client.deleteTest(testId);
}

@Ignore("https://github.com/PerfCake/PerfRepo/issues/95")
Copy link
Member

Choose a reason for hiding this comment

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

please remove it. I looked on it and this is not a broken test, but a serious bug in perfrepo which needs to be fixed ASAP. This just hides it.

@@ -485,12 +486,12 @@ private Double getValueFromMetric(TestExecution testExecution) {
private CommonTree parseTree(String string) {
//lexer splits input into tokens
ANTLRStringStream input = new ANTLRStringStream(string);
TokenStream tokens = new CommonTokenStream(new AlertingDSLLexer(input));
TokenStream tokens = new CommonTokenStream(new org.perfrepo.web.alerting.AlertingDSLLexer(input));
Copy link
Member

Choose a reason for hiding this comment

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

well, I can understand re-ordering of imports (done by IDE) until we have some formatting rules, but don't understand why we should use fully qualified names in couple of places. Please remove it unless you have a good reason to use it.

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

Successfully merging this pull request may close these issues.

2 participants