NASA-PDS / registry-mgr

Standalone Registry Manager application responsible for managing the PDS Registry (https://github.com/NASA-PDS/registry) schemas and indexes.
https://nasa-pds.github.io/registry
Other
0 stars 2 forks source link

GitHub action to run integration tets #24

Closed tdddblog closed 3 years ago

tdddblog commented 3 years ago

See https://github.com/NASA-PDS/pds-registry-app/issues/154

tdddblog commented 3 years ago

🤪 Unstable integration & delivery is failing because of wrong JDK version. It is trying to compile with JDK 1.8, but JDK 11 is required to build registry manager and harvest.

tdddblog commented 3 years ago

Fixed JDK issue in Unstable integration & delivery, but now it fails with

CRITICAL:pds.roundup.util:💥 Process with command line ['git', 'pull', 'origin', 'master'] failed with status 128
CRITICAL:pds.roundup.util:🪵 Stdout = «»
CRITICAL:pds.roundup.util:📚 Stderr = «From https://github.com/NASA-PDS/pds-registry-mgr-elastic
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
fatal: refusing to merge unrelated histories
jordanpadams commented 3 years ago

@tdddblog I imagine this actually going to fail for all repos because it is trying to work off of master by default and there is no way to specify the current branch in roundup. Sigh. Will try to look later today or this weekend unless @nutjob4life is blocked on the API and can take a look 😎

nutjob4life commented 3 years ago

You can have multiple workflow files with different triggering events. For example, suppose a repository had:

And integration-only.yaml contained:

on:
    push:
        branches-ignore:
            - 'main'
            - 'master'
jobs:
    integration-test:
        name: ∫ Integration Test
        runs-on: ubuntu-latest
        steps:
            -
                name: 💳 Check it out
                uses: actions/checkout@v2
                with:
                    lfs: true
                    token: ${{secrets.ADMIN_GITHUB_TOKEN}}
                    fetch-depth: 0
                    # The `ref` is not necessary; it defaults to the branch that triggered the workflow
            -
                name: ∲ Run integration test
                run: |
                    integ-o-matic --run-parallel 4 --module blah

The above ↑ would be run on a push to any branch but master (or main as it should be called these days; master is passé and potentially offensive). It'll do the integration test only on pushes to non-main branches.

The Roundup could be used here in place of integ-o-matic or whatever but we'd need to configure it to do a different kind of assembly because the standard assemblies also include creating releases.

Right now it supports three kinds of assemblies:

Only the last two can actually be invoked, but the framework is there to support n kinds of assemblies.

EDIT: after typing this comment I see you do already have an extra .yaml file in this commit! The key, then, is branches-ignore.

jordanpadams commented 3 years ago

thanks @nutjob4life . i was hoping to be able to fix that integration issue easily across all repos by replacing the previous with **, but of course it cannot be that easy :-) .

jordanpadams commented 3 years ago

@nutjob4life actually, thinking about this some more, part of the reason we want to use the unstable_cicd on branches is so that we could potentially tag a SNAPSHOT a tester could use to test with for a PR. not sure if that makes sense, but that was part of the thought process here. it looks like we reference master directly here and here where I think if we just referenced the current branch (or passed it in via the Github action, the part where it breaks would not be an issue