Skip to content

Commit

Permalink
Merge pull request #17149 from github/criemen/pytest-go
Browse files Browse the repository at this point in the history
Port the go integration tests to pytest framework
  • Loading branch information
criemen authored Aug 9, 2024
2 parents d97f657 + cdf0677 commit d82f66c
Show file tree
Hide file tree
Showing 81 changed files with 86 additions and 162 deletions.
26 changes: 0 additions & 26 deletions go/integration-tests-lib/go_integration_test.py

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from go_integration_test import *

go_integration_test()
def test(codeql, go):
codeql.database.create(source_root="src")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from go_integration_test import *

go_integration_test()
def test(codeql, go):
codeql.database.create(source_root="src")
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
import pytest

from go_integration_test import *

os.environ['LGTM_INDEX_IMPORT_PATH'] = "test"
go_integration_test(source="work", db=None)
def test(codeql, go, check_build_environment):
check_build_environment.source_root = "work"
os.environ["LGTM_INDEX_IMPORT_PATH"] = "test"
codeql.database.create(source_root="work")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os

from go_integration_test import *

os.environ['LGTM_INDEX_IMPORT_PATH'] = "test"
go_integration_test(source="work")
def test(codeql, go, check_build_environment):
check_build_environment.source_root = "work"
os.environ["LGTM_INDEX_IMPORT_PATH"] = "test"
codeql.database.create(source_root="work")
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from go_integration_test import *

os.environ['LGTM_INDEX_IMPORT_PATH'] = "test"
go_integration_test()
def test(codeql, go):
os.environ["LGTM_INDEX_IMPORT_PATH"] = "test"
codeql.database.create(source_root="src")
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os

from go_integration_test import *

os.environ['LGTM_INDEX_IMPORT_PATH'] = "test"
go_integration_test(source="work", db=None, runFunction=runUnsuccessfully)
def test(codeql, go, check_build_environment):
check_build_environment.source_root = "work"
os.environ["LGTM_INDEX_IMPORT_PATH"] = "test"
codeql.database.create(source_root="work", _assert_failure=True)
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os

from go_integration_test import *

os.environ['LGTM_INDEX_IMPORT_PATH'] = "test"
go_integration_test(source="work", db=None, runFunction=runUnsuccessfully)
def test(codeql, go, check_build_environment):
check_build_environment.source_root = "work"
os.environ["LGTM_INDEX_IMPORT_PATH"] = "test"
codeql.database.create(source_root="work", _assert_failure=True)
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os

from go_integration_test import *

os.environ['LGTM_INDEX_IMPORT_PATH'] = "test"
go_integration_test(source="work", db=None)
def test(codeql, go, check_build_environment):
check_build_environment.source_root = "work"
os.environ["LGTM_INDEX_IMPORT_PATH"] = "test"
codeql.database.create(source_root="work")
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os

from go_integration_test import *

os.environ['LGTM_INDEX_IMPORT_PATH'] = "test"
go_integration_test(source="work", db=None)
def test(codeql, go, check_build_environment):
check_build_environment.source_root = "work"
os.environ["LGTM_INDEX_IMPORT_PATH"] = "test"
codeql.database.create(source_root="work")
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os

from go_integration_test import *

os.environ['GITHUB_REPOSITORY'] = "a/b"
go_integration_test(source="work", db=None)
def test(codeql, go, check_build_environment):
check_build_environment.source_root = "work"
os.environ["GITHUB_REPOSITORY"] = "a/b"
codeql.database.create(source_root="work")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from go_integration_test import *
import os

os.environ['CODEQL_EXTRACTOR_GO_EXTRACT_VENDOR_DIRS'] = "true"
go_integration_test()

def test(codeql, go):
os.environ["CODEQL_EXTRACTOR_GO_EXTRACT_VENDOR_DIRS"] = "true"
codeql.database.create(source_root="src")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from go_integration_test import *

go_integration_test()
def test(codeql, go):
codeql.database.create(source_root="src")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from go_integration_test import *

go_integration_test()
def test(codeql, go):
codeql.database.create(source_root="src")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from go_integration_test import *

go_integration_test()
def test(codeql, go):
codeql.database.create(source_root="src")
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from go_integration_test import *

go_integration_test()
def test(codeql, go):
codeql.database.create(source_root="src")

This file was deleted.

5 changes: 2 additions & 3 deletions go/ql/integration-tests/all-platforms/go/make-sample/test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from go_integration_test import *

go_integration_test()
def test(codeql, go):
codeql.database.create(source_root="src")

This file was deleted.

5 changes: 2 additions & 3 deletions go/ql/integration-tests/all-platforms/go/mixed-layout/test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from go_integration_test import *

go_integration_test()
def test(codeql, go):
codeql.database.create(source_root="src")

This file was deleted.

5 changes: 2 additions & 3 deletions go/ql/integration-tests/all-platforms/go/ninja-sample/test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from go_integration_test import *

go_integration_test()
def test(codeql, go):
codeql.database.create(source_root="src")
5 changes: 0 additions & 5 deletions go/ql/integration-tests/all-platforms/go/qlpack.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from go_integration_test import *

go_integration_test(toolchain="go1.21.0")
def test(codeql, go, check_build_environment):
check_build_environment.env = {"GOTOOLCHAIN": "go1.21.0"}
codeql.database.create(source_root="src")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from go_integration_test import *

go_integration_test()
def test(codeql, go):
codeql.database.create(source_root="src")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from go_integration_test import *

go_integration_test()
def test(codeql, go):
codeql.database.create(source_root="src")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from go_integration_test import *

go_integration_test()
def test(codeql, go):
codeql.database.create(source_root="src")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from go_integration_test import *

go_integration_test()
def test(codeql, go):
codeql.database.create(source_root="src")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from go_integration_test import *

go_integration_test()
def test(codeql, go):
codeql.database.create(source_root="src")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from go_integration_test import *

go_integration_test()
def test(codeql, go):
codeql.database.create(source_root="src")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from go_integration_test import *

go_integration_test()
def test(codeql, go):
codeql.database.create(source_root="src")

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from go_integration_test import *

go_integration_test()
def test(codeql, go):
codeql.database.create(source_root="src")
1 change: 0 additions & 1 deletion go/ql/integration-tests/legacy

This file was deleted.

This file was deleted.

9 changes: 6 additions & 3 deletions go/ql/integration-tests/linux-only/go/dep-sample/test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import os
import runs_on

from go_integration_test import *

os.environ['LGTM_INDEX_IMPORT_PATH'] = "deptest"
go_integration_test(source="work")
@runs_on.linux
def test(codeql, go, check_build_environment):
check_build_environment.source_root = "work"
os.environ["LGTM_INDEX_IMPORT_PATH"] = "deptest"
codeql.database.create(source_root="work")
9 changes: 6 additions & 3 deletions go/ql/integration-tests/linux-only/go/glide-sample/test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import os
import runs_on

from go_integration_test import *

os.environ['LGTM_INDEX_IMPORT_PATH'] = "glidetest"
go_integration_test(source="work")
@runs_on.linux
def test(codeql, go, check_build_environment):
check_build_environment.source_root = "work"
os.environ["LGTM_INDEX_IMPORT_PATH"] = "glidetest"
codeql.database.create(source_root="work")
5 changes: 0 additions & 5 deletions go/ql/integration-tests/linux-only/go/qlpack.yml

This file was deleted.

0 comments on commit d82f66c

Please sign in to comment.