Skip to content

Commit

Permalink
Tag ent tests (guacsec#1200)
Browse files Browse the repository at this point in the history
* Tag ent tests

Put ent tests behind tag integrationEnt until we have infra to bring up a
postgres instance in our integration tests.

Signed-off-by: Jeff Mendoza <jlm@jlm.name>

* Tag ent tests with integration

Update workflows to only startup postgres on integration tests. Remove
uneccessary github secret references, those are only used in integration-merge
tests.

Signed-off-by: Jeff Mendoza <jlm@jlm.name>

---------

Signed-off-by: Jeff Mendoza <jlm@jlm.name>
Signed-off-by: m-brophy <mbrophy@redhat.com>
  • Loading branch information
jeffmendoza authored and m-brophy committed Aug 31, 2023
1 parent c7c81a8 commit da3ed46
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 18 deletions.
19 changes: 1 addition & 18 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,12 @@ jobs:
run: go mod download
- name: Run integration tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENT_TEST_DATABASE_URL: 'postgresql://guac:guac@localhost/guac?sslmode=disable'
run: make integration-test

test-unit:
runs-on: ubuntu-latest
name: CI for unit tests
services:
postgres:
image: postgres
env:
POSTGRES_USER: guac
POSTGRES_PASSWORD: guac
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # tag=v3
Expand All @@ -103,8 +88,6 @@ jobs:
- name: Setup the project
run: go mod download
- name: Run tests
env:
ENT_TEST_DATABASE_URL: 'postgresql://guac:guac@localhost/guac?sslmode=disable'
run: make test

static-analysis:
Expand Down
2 changes: 2 additions & 0 deletions pkg/assembler/backends/ent/backend/artifact_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration

package backend

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/assembler/backends/ent/backend/certify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration

package backend

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/assembler/backends/ent/backend/dependency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration

package backend

// func (s *Suite) TestIsDependency() {
Expand Down
2 changes: 2 additions & 0 deletions pkg/assembler/backends/ent/backend/hashequal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration

package backend

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/assembler/backends/ent/backend/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration

package backend

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/assembler/backends/ent/backend/neighbors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration

package backend

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/assembler/backends/ent/backend/occurrence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration

package backend

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/assembler/backends/ent/backend/package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration

package backend

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/assembler/backends/ent/backend/pkgequal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration

package backend

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/assembler/backends/ent/backend/sbom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration

package backend

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/assembler/backends/ent/backend/scorecard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration

package backend

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/assembler/backends/ent/backend/search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration

package backend

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/assembler/backends/ent/backend/slsa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration

package backend

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/assembler/backends/ent/backend/software_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration

package backend

// Usually this would be part of ent, but the import cycle doesn't allow for it.
Expand Down
2 changes: 2 additions & 0 deletions pkg/assembler/backends/ent/backend/source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration

package backend

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/assembler/backends/ent/backend/vex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration

package backend

// func (s *Suite) TestVEX() {
Expand Down
2 changes: 2 additions & 0 deletions pkg/assembler/backends/ent/backend/vulnerability_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build integration

package backend

//var c1 = &model.VulnerabilityInputSpec{
Expand Down

0 comments on commit da3ed46

Please sign in to comment.