From 8b49056cbf6fec98bec2f8d9751af3e717a0de7a Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sun, 17 Nov 2024 10:14:34 +0530 Subject: [PATCH 1/2] added model coverage --- .github/workflows/publish.yml | 6 +++++- CHANGELOG.md | 3 +++ pub_login.sh | 4 ++-- test/network_tools_test.dart | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 618f46a..d49c8aa 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,6 +7,8 @@ on: jobs: publish: runs-on: ubuntu-latest + permissions: + id-token: write # Required for authentication using OIDC steps: - name: Checkout @@ -50,7 +52,9 @@ jobs: run: dart pub publish --dry-run - name: Publish Package - run: dart pub publish -f + uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 + with: + environment: 'pub.dev' - name: Upload Coverage to CodeCov uses: codecov/codecov-action@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index b918e11..2ddbd4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## 5.0.4 + + ## 5.0.3 Updated dependencies diff --git a/pub_login.sh b/pub_login.sh index 441cffb..f13fdab 100644 --- a/pub_login.sh +++ b/pub_login.sh @@ -1,4 +1,4 @@ -# This script creates/updates credentials.json file which is used +# This script creates/updates ~/Library/Application\ Support/dart/pub-credentials.json file which is used # to authorize publisher when publishing packages to pub.dev # Checking whether the secrets are available as environment @@ -30,7 +30,7 @@ cat < $HOME/.config/dart/pub-credentials.json "refreshToken":"${PUB_DEV_PUBLISH_REFRESH_TOKEN}", "tokenEndpoint":"${PUB_DEV_PUBLISH_TOKEN_ENDPOINT}", "idToken": "${PUB_DEV_PUBLISH_ID_TOKEN}", - "scopes":["openid","https://www.googleapis.com/auth/userinfo.email"], + "scopes":["https://www.googleapis.com/auth/userinfo.email","openid"], "expiration":${PUB_DEV_PUBLISH_EXPIRATION} } EOF \ No newline at end of file diff --git a/test/network_tools_test.dart b/test/network_tools_test.dart index 2d46c86..c0af705 100644 --- a/test/network_tools_test.dart +++ b/test/network_tools_test.dart @@ -54,6 +54,10 @@ void main() { test('Running OpenPort tests', () { final actualOpenPort = openPort; final expectedOpenPort = OpenPort(port); + final json = { + 'port': expectedOpenPort.port, + 'isOpen': expectedOpenPort.isOpen, + }; if (actualOpenPort != null) { expect(actualOpenPort, expectedOpenPort); @@ -62,6 +66,35 @@ void main() { expect(expectedOpenPort.isOpen, equals(true)); // because default is true expect(expectedOpenPort.hashCode, expectedOpenPort.port.hashCode); expect(expectedOpenPort.toString(), expectedOpenPort.port.toString()); + expect(expectedOpenPort.toJson(), json); + expect(OpenPort.fromJson(json), expectedOpenPort); + }); + test('Running ARPData tests', () { + final json = { + 'hostname': 'Local', + 'iPAddress': '192.168.1.1', + 'macAddress': '00:00:3F:C1:DD:3E', + 'interfaceName': 'eth0', + 'interfaceType': 'bridge', + }; + + final arpData = ARPData.fromJson(json); + expect(arpData.toJson(), json); + expect(arpData.notNullIPAddress, true); + expect(arpData.notNullMacAddress, true); + expect(arpData.notNullInterfaceType, true); + }); + + test('Running Vendor tests', () { + final json = { + 'macPrefix': '00:00:0C', + 'vendorName': 'Cisco Systems, Inc', + 'private': 'false', + 'blockType': 'MA-L', + 'lastUpdate': '2015/11/17', + }; + final vendor = Vendor.fromJson(json); + expect(vendor.toJson(), json); }); }); From f0b54e3fd21824c16e4bb54d4eb026a2417a1f6a Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sun, 17 Nov 2024 10:17:46 +0530 Subject: [PATCH 2/2] Release v5.0.4 --- CHANGELOG.md | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ddbd4d..c33de12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Change Log ## 5.0.4 - +Updated dependencies, added tests, and updated GHA. ## 5.0.3 Updated dependencies diff --git a/pubspec.yaml b/pubspec.yaml index 57afff7..0381d61 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: network_tools description: Networking Tools library which can help you discover open ports, devices on subnet and many other things. -version: 5.0.3 +version: 5.0.4 issue_tracker: https://github.com/osociety/network_tools/issues repository: https://github.com/osociety/network_tools