Modify

Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#16819 closed enhancement (fixed)

[PATCH] travis: build against jdk 10 and 11

Reported by: ris Owned by: team
Priority: minor Milestone: 18.10
Component: Unit tests Version:
Keywords: travis tests ant java9 java10 java11 Cc:

Description

This requires bumping ant versions - the ant supplied by travis on trusty doesn't recognize java >8. fetching
it "manually" is ugly but does allow us to unify ant installation across OSs.

I've removed jdk9 as it seems like overkill now, but I've left in the headless=false builds because I still have some naive hope that people will be able to battle against them and get them passing. Or perhaps I'm looking at that wrong and what I should be doing is simply accepting that many tests were not designed to work with non-headless mode and set them to skip. This way at least we'd be able to catch regressions from just a glance at the build's success or failure.

As for the macos build - it's just failing on one test related to keyboard shortcuts - ideally I'd like someone more familiar with macos and the keyboard shortcut system to go in and fix it but all I can do is wish.

https://github.com/openstreetmap/josm/pull/37

Attachments (1)

v1-0001-travis-build-against-jdk-10-and-11-requiring-a-bu.patch (1.6 KB) - added by ris 8 months ago.

Download all attachments as: .zip

Change History (17)

comment:1 Changed 8 months ago by Don-vip

Milestone: 18.10

comment:2 Changed 8 months ago by Don-vip

Resolution: fixed
Status: newclosed

In 14307/josm:

fix #16819 - travis: build against jdk 10 and 11 (patch by ris)

comment:3 Changed 8 months ago by Don-vip

How do we get details about test failures on Travis? I only see the following:

    [junit] Tests run: 13, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 20.638 sec
    [junit] TEST org.openstreetmap.josm.gui.MainApplicationTest FAILED
    [junit] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.193 sec
    [junit] TEST org.openstreetmap.josm.tools.KeyboardUtilsTest FAILED

comment:4 Changed 8 months ago by ris

Unless we have e.g. an S3 bucket to point it at, we don't unfortunately.

(It doesn't necessarily have to be S3, it could any random place we could e.g. scp the results to, but we'd have to cobble together our own uploading steps and means of hiding the credentials)

comment:5 Changed 8 months ago by Don-vip

In 14308/josm:

see #16819 - should fix KeyboardUtilsTest on macOS

comment:6 in reply to:  4 Changed 8 months ago by Don-vip

Replying to ris:

(It doesn't necessarily have to be S3, it could any random place we could e.g. scp the results to, but we'd have to cobble together our own uploading steps and means of hiding the credentials)

It's overkill, I'll find another way :)

comment:7 Changed 8 months ago by Don-vip

How does the travis.yml works? I don't understand why ANT_INVOCATION is defined three times:

env:
  - ANT_INVOCATION="xvfb-run ant -Dtest.headless=false"
  - ANT_INVOCATION="ant -Dtest.headless=true"
...
    env: ANT_INVOCATION="ant -Dtest.headless=true"

If I want to add an additional parameter, do I need to add it three times?

comment:8 Changed 8 months ago by Don-vip

In 14309/josm:

see #16819 - log more information when running junit tests on Travis

comment:9 Changed 8 months ago by ris

Specifying it twice causes it to be enumerated across the matrix of tested environments - it will evaluate each environment for each setting of that variable.

It then sets it a single time for the macos run (because it can't do non-headless on travis afaik)

I *think* if you set a particular variable a single time it doesn't do any multiplication magic and only leaves it set to that value for all executions.

p.s. there is a system in travis for being able to set "encrypted" credentials but I haven't looked into it too hard.

comment:10 Changed 8 months ago by Don-vip

In 14312/josm:

see #16819 - Travis: display output of failed tests only to avoid exceeding the maximum log length

comment:11 Changed 8 months ago by Don-vip

It works :) Here's the macOS error:

Testcase: testGetRegisteredActionShortcut took 1.285 sec
	FAILED
expected:<org.openstreetmap.josm.actions.AboutAction@706e52f3> but was:<null>
junit.framework.AssertionFailedError: expected:<org.openstreetmap.josm.actions.AboutAction@706e52f3> but was:<null>
	at org.openstreetmap.josm.gui.MainApplicationTest.testGetRegisteredActionShortcut(MainApplicationTest.java:297)
	at org.openstreetmap.josm.testutils.JOSMTestRules$TimeoutThread.run(JOSMTestRules.java:700)

comment:12 Changed 8 months ago by ris

Yeah last time I dug into this that's about the conclusion I came to and indeed if you look further it looks like the shortcut isn't being registered for that action, but I didn't know whether this is just an "expected" platform difference, what may be causing this, how long this test has been failing on macos...?

comment:13 Changed 8 months ago by Don-vip

Indeed system:about is reserved for macOS. We should try another action.

comment:14 Changed 8 months ago by Don-vip

In 14313/josm:

see #16819 - use another action to make test pass on macOS

comment:15 Changed 8 months ago by Don-vip

OK, macOS build fixed. Only non-headless builds are failing now. With 29 failed tests only, I think this is worth the effort :)

comment:16 Changed 8 months ago by ris

That does sound very tempting. I was about to start writing more plugin tests, but it would be good to nail the non-headless ones.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.