Northern Virginia legislators won a major victory early this morning when the General Assembly, staggering toward the end of its 1982 session, passed a tax and spending package that for the first time commits the state's general revenues to support of the Metro transit system.

The package, hammered out by House and Senate conferees with the help of Gov. Charles S. Robb, includes a 3 percent tax on wholesale gasoline sales and will raise the prices at the pump by as much as 4 cents a gallon. The new taxes, effective July 1, will help finance a total of $41.7 million in state subsidies for Metro during the next two years.

Of that amount $28 million will be earmarked to meet the system's rising operating costs.

Moments before the assembly's 5:37 a.m. adjournment--as legislators were falling asleep in their chairs--Robb proposed and the legislature approved the repeal of a scheduled 2 percent increase in Northern Virginia's regional gasoline tax. That increase, which would have gone into effect in communities with Metro service in July, was to have been added to the original 2 percent regional gasoline tax approved two years ago during an earlier struggle over Metro.

"Northern Virginia has had the greatest accomplishment today that I've seen in the 17 years I've been down here," an exhausted Sen. Adelard L. Brault (D-Fairfax), a pivotal figure in the negotiations, said shortly before dawn.

As adjournment approached, the weary legislators also gave final approval to a severely weakened conflict-of-interest measure that requires the state's 140 legislators to disclose more details about their business interests.

The watered-down bill was the only one of a dozen ethics measures to survive the scrutiny of both houses this year, following a numerous conflict-of-interest allegations that had many lawmakers troubled about their reputations.

Some lawmakers said the bill falls far short of what is needed to curb legislators from using their public positions to their own economic advantage. "It has a number on it and it has a name on it," said Del. Samuel Glasscock (D-Suffolk), who had unsuccessfully attempted to strengthen the measure on the House floor. "It doesn't have much else."

The Senate--hit hardest by the conflict charges-acted yesterday to create an independent ethics commission, composed of appointees from outside its membership, that would gather facts in conflict-of-interest cases. The Senate measure, adopted as part of its rules, does not apply to the 100-member House of Delegates.

In other final action, the General Assembly passed a measure sought by Northern Virginia apartment owners to bar local assessors from taxing rental properties at condominium-inflated values. That practice, used first in Arlington and more recently in Alexandria, has led to dramatic increases in tax bills for apartments in an area swept by condominium conversions.

The bill, opposed by some Northern Virginia localities that fear it will lead to higher tax rates, is expected to be challenged in court, although state Attorney General Gerald Baliles has called it constitutional.

In all, the 1982 session, the first with a Democratic governor in 12 years, found lawmakers lifting credit-card interest rates,imposing harsher prison sentences for certain criminals, approving a series of measures to give women more rights in property settlements and allowing motorists to get their cars inspected once a year, rather than every six months.

The legislature also passed a measure, introduced by Robb late in the session, that would allow Fairfax County and other localities to award exclusive franchises to cable television companies, intended to counteract a recent Supreme Court ruling jeopardizing that authority. In a lighter vein, the assembly also designated milk as the Virginia state drink--over the humorous protests of those who felt "Virginia Gentleman" bourbon would be more approporiate.

Killed this year were some of Virginia's hardier perennials--the Equal Rights Amendment, legislation to require deposits on bottles and cans, a holiday for Martin Luther King and a bill that would allow Arlington to have an elected school board.

On the last day, the lawmakers met in an giddy atmosphere of hurried hallway conferences and droning floor debates as a somnolent membership struggled to stay awake for decisions that ended a 60-day session. "How can you argue about truth and justice at this hour of the morning?" quipped Senate Majority Leader Hunter B. Andrews (D-Hampton) as a colleague debated a bill at 5 a.m.

Legislators amused themselves by keeping track of who fell asleep and summoning news photographers to record their hapless, often snoring colleagues. "Everyone's tired, our nerves are frayed, we're all ready to go home and the most important item of this session is coming up at 4 in the morning," groused Del. Clinton Miller (R-Shenandoah) as the state's $13.1 billion biennial arrived on the floor for final action. "I think the people of the commonwealth deserve better than this."

For Northern Virginia legislators, the high point of the session's final day was the approval of the Metro package, which they agreed last fall was their most important goal of the session. Until this morning Metro was to get only $13.7 million from the state during the next two years, a drop of 33 percent the current rate of funding.

When the controversial gasoline tax passed the House, there was short burst of cheers from the Northern Virginians who quickly muted their celebration for fear of further antogonizing colleagues from other areas of the state. "I think Metro had better lay low for a while," said one lobbyist after the vote.

As it was, there were disgruntled legislators who feared that Virginia today took a dangerous step in committing itself to support of the transit system's operating costs. "All of us who are not residents of Northern Virginia are very apprehensive about it," said House Speaker A.L. Philpott, a resident of the small town of Bassett near the North Carolina border. "This bill will exactly double funding for Metro and next year it may very well be $60 million. Once the concept is adopted, there's no telling where this is going to stop."

Philpott and others credited the Northern Virginia delegation's tough bargaining strategy with breaking the legislature's decade-old resistance to increased funding for Metro. Of the 21 Northern Virginians in the House, only two--Republican delegates Kenneth B. Rollins of Loudoun and Harry J. Parrish of Prince William--voted today against the gasoline tax measure. The final vote on the tax was 57 to 41 in the House, 23 to 13 in the Senate.

"I think the Northern Virginia caucus has a significant strength here by virtue of their numbers. As one delegate told me, that's the third political party here," Philpott said.

Early in the session, the Northern Virginians insisted that they would not vote for any gasoline tax increase unless the some of the new revenues were directed to Metro. That strategy peaked in the House of Delegates last week when a coalition of Northern Virginians and representatives from the state's other rapidly growing suburbs came one vote short of torpedoing a gasoline tax bill.

That coalition splintered this morning, leaving a residue of bitter feelings among some suburban legislators. But for Del. Warren Stambaugh (D-Arlington), credited with putting the coalition together, there was no choice but to vote for the package. "How can I vote against $28 million for Metro?" he said.

The new wholesale gasoline tax increase is expected to generate $174 million during the next two years. In addition, the legislature also approved $89 million in assorted truck and vehicle licensing fees to be raised over the 1983-1984 biennium.

New revenues for Virginia's troubled Highway and Transportation Department were given a top priority by Robb when he took office two months ago. Although legislators credited his administration with helping to push the bill through a reluctant House of Delegates, Robb had refrained throughout the session from specifically endorsing any one form of gasoline tax.

The gasoline tax that emerged this morning was one originally introduced by Sen. Edward E. Willey (D-Richmond), chairman of the Senate Finance Committee who left the session several weeks ago after he was stricken ill. In his absence, Majority Leader Andrews emerged as the key figure in the evolving strategies over highway finances and today, was given credit by Brault for resolving Metro's funding difficulties.