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

Travis: Separating Postgres & Mongo scripts #6505

Merged
merged 65 commits into from
Mar 19, 2020
Merged

Travis: Separating Postgres & Mongo scripts #6505

merged 65 commits into from
Mar 19, 2020

Conversation

cbaker6
Copy link
Contributor

@cbaker6 cbaker6 commented Mar 14, 2020

Fix #6374

@dplewis
Copy link
Member

dplewis commented Mar 14, 2020

Checking...

Nice

I tried apt-get before I hope it works.

@cbaker6
Copy link
Contributor Author

cbaker6 commented Mar 14, 2020

@dplewis I hope it catches the removal of all postgres versions. I watched the Xenial build during it's initial install and it looks like it installs way more versions of postgres than what's listed on the site

.travis.yml Outdated
@@ -34,6 +34,9 @@ before_install:
- nvm install $NODE_VERSION
- nvm use $NODE_VERSION
- npm install -g greenkeeper-lockfile@1
- sudo apt-get remove -q 'postgresql-*'
- sudo apt-get update -q
- sudo apt-get install -q postgresql-11 postgresql-11-postgis-2.5 postgresql-11-postgis-2.5-scripts
Copy link
Member

@dplewis dplewis Mar 14, 2020

Choose a reason for hiding this comment

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

We should only install this for PG build to improve speed. If we can’t get it to work we can downgrade to 10.

I can open an issue on Travis to prevent this

@cbaker6
Copy link
Contributor Author

cbaker6 commented Mar 14, 2020

@dplewis does the error, "role travis doesn't exist" happen often. It popped up in one of the test and looks like it's stuck in a loop

@codecov
Copy link

codecov bot commented Mar 14, 2020

Codecov Report

Merging #6505 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #6505   +/-   ##
======================================
  Coverage      94%     94%           
======================================
  Files         169     169           
  Lines       11825   11825           
======================================
  Hits        11116   11116           
  Misses        709     709
Impacted Files Coverage Δ
src/RestWrite.js 93.64% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c2391f...839d3e6. Read the comment docs.

@dplewis
Copy link
Member

dplewis commented Mar 14, 2020

@cbaker6 Thanks for working together with me on this.

@cbaker6
Copy link
Contributor Author

cbaker6 commented Mar 14, 2020

@dplewis np, though it looks the lines I've added may have caused an issue

@cbaker6
Copy link
Contributor Author

cbaker6 commented Mar 17, 2020

Moved the postgres scripts to files

.travis.yml Outdated Show resolved Hide resolved
Copy link
Member

@dplewis dplewis left a comment

Choose a reason for hiding this comment

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

LGTM!

Thanks for working on this @cbaker6. Looks like the build speed has improved as well.

Lets see how this goes

@dplewis dplewis merged commit 352eeb2 into parse-community:master Mar 19, 2020
UnderratedDev pushed a commit to UnderratedDev/parse-server that referenced this pull request Mar 21, 2020
* Attempting to fix Postgres issue

* Attempting to fix Postgres issue

trying to stop loop

* Attempting to fix Postgres

isolating postgres calls

* Attempting to fix Postgres issue

Separating jobs

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

Separating builds again

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

Just added back version 10, just in case it gets called

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

* Update .travis.yml

* Attempting to fix postgres

Removed postgres installs from unneeded test cases. Added the ability to test Postgres 10 and 11

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

* Attempting to fix postgres

Added test for postgres 12 that's allowed to fail

* Attempting to fix postgres

* Attempting to fix postgres 

Second round to see if it fails eventually

* Attempting to fix postgres

Round 3

* Attempting to fix postgres

Allowing all postgres to fail since it seems to occur randomly

* Temporary fix: separated mongo and postgres in travis

Now the mongo and postgres scripts are independent of each other to prevent the `ERROR:  could not access file "$libdir/postgis-2.4": No such file or directory` of showing up in the rest of the builds.

In addition, a test for postgres-12 has been added for future compatibility. Both the postgres-11 and postgres-12 have been added to `allow_failures` because the aforementioned error still creeps up. Important note is that the error has nothing to do with compatibility with postgres, but rather seems to be an error of how postgres (or really postgis) is being referenced in the respective travis distribution. Lastly, this error, if truly random should appear less than before as the postgres scripts aren't being run for every build as it previously was running.

* Allowing all postgres to fail

* Allowing multiple names to fail

* Removing preinstalled versions of postgres from list

Seeing if this gets rid of the random error

* Use postgres made for dist

* Second round

* Round 3

* Round 4

* Round 5

* Fixed issue with random postgres fail

Removing the native postgres builds at the right time seems to have fixed the random error from before.

The postgres tests are now not allowed to fail.

* Added back postgres 11 and 12 to allow_failures

The actual problem is fixed, but it seems there are some instability with some of the test cases for postgres that need to be addressed at another time.

The issues that pop up are: 
- Postgres-11
```Failures:
1) Cloud Code cloud jobs should set the message / success on the job
  Message:
    Expected undefined to equal 'hello'.
  Stack:
    Error: Expected undefined to equal 'hello'.
        at <Jasmine>
        at req.message.then.then.jobStatus (/home/travis/build/parse-community/parse-server/spec/CloudCode.spec.js:1571:46)
        at process._tickCallback (internal/process/next_tick.js:68:7)
```

- Postgres-12
``` 
Failures:
1) Cloud Code cloud jobs should set the message / success on the job
  Message:
    Expected undefined to equal 'hello'.
  Stack:
    Error: Expected undefined to equal 'hello'.
        at <Jasmine>
        at req.message.then.then.jobStatus (/home/travis/build/parse-community/parse-server/spec/CloudCode.spec.js:1571:46)
        at process._tickCallback (internal/process/next_tick.js:68:7)
  Message:
    Expected 'running' to equal 'succeeded'.
  Stack:
    Error: Expected 'running' to equal 'succeeded'.
        at <Jasmine>
        at promise.then.then.jobStatus (/home/travis/build/parse-community/parse-server/spec/CloudCode.spec.js:1580:45)
        at process._tickCallback (internal/process/next_tick.js:68:7)
```

* added travis scripts for postgres

* Setting up before_install and before_script

This should shrink the footprint of the file and and reduce the redundancy of calls for postgres.

Added support for testing of Postgres 9 and 10 in the scripts, not adding the tests though

* make scripts executable

* Update .travis.yml

* add sourcing in script

* trying to fix source

* fixing env var in script

* fixed ; near then

* Cleaning up travis file

removed old lines

* Finishing clean up

* Fixing allow_failures since "name" was removed

* Update .travis.yml

* Removed Postgres 11 from allow_failures

* I think using travis default postgres port of 5433 will allow us to not have to remove anything from the image

* Switching travis to postgres port 5433

* modifying script for test

* modifying script for test

* modifying script for test

* reverting back to working way with removing postgres from image

* Reverted back to removing postgres from image

* removing postgres 12

* removed postgres-12 from allow_failures
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 this pull request may close these issues.

Proposal to DROP SUPPORT of Postgres due to ongoing CI Instability
2 participants